python appscript模块创建k.type对象

2024-06-25 23:15:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在学习并享受appscript模块,但我有点困惑 关于如何实例化基本k.type对象。 例如,如果我想创建一个包含k.boolean值的变量 在编写应用程序脚本时使用, 如何创建它,然后将其传递给属性的set()方法 在应用程序中?在

假设我正在编写Adobe Illustrator脚本:

il = app('Adobe Illustrator')
doc = il.current_document.get()
layers = doc.layers.get()
layer = layers[1]

在Illustrator中,层对象有一个属性图层可见,它有一个 k、 布尔值。在

如何创建k.boolean类型的变量m,以便:

^{pr2}$

将.visible属性设置为不同的k.boolean值?在

m = k.boolean(True) # doesn't work
m = make(new k.boolean) # doesn't work

Tags: 模块对象脚本应用程序getdoc属性layers