(这让我想起了自己大学时候折腾 ubuntu
时也是搞崩了无数次,而且不是虚拟机,有一段时间里,每天就重复着安装、崩溃、重装的过程,说实话有点枯燥无味,不过这个过程中熟悉了不少
linux 常用命令的使用。下图是以前折腾出来的一个 ubuntu 的 3D 效果,em...
当初搞这个纯粹是觉得酷炫,实际上没什么用。)
tellapplication"Capture One 21" tellapplication"System Events" tell process "Capture One 21" UI elements endtell endtell endtell
输出:
1
{window "Capture One Catalog" of application process "Capture One 21" of application "System Events", menu bar 1 of application process "Capture One 21" of application "System Events"}
如果我们想再获取 UI 元素里面的子元素,可以使用
of,如:
1 2 3 4 5 6 7
tellapplication"Capture One 21" tellapplication"System Events" tell process "Capture One 21" UI elements of window "Capture One Catalog"-- 这里的 window "Capture One Catalog" 是通过 UI elements 获取的元素 endtell endtell endtell
{image 1 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", static text "1/90 s" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", slider 1 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 1 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", static text "ISO 200" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", static text "Alex_Benes.RAF" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", UI element 7 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", static text "120" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", static text "148" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", static text "125" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", static text "100" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 2 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 3 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 4 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", group 1 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", static text "1/6" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 5 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 6 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 7 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 8 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", group 2 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", radio group 1 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", toolbar 1 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 9 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 10 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", button 11 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", image "Capture One.cocatalogdb" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events", static text "Capture One Catalog" of window "Capture One Catalog" of application process "Capture One 21" of application "System Events"}
同理,如果我们再想获取下一级的子元素,同样可以使用
of,如:
1 2 3 4 5 6 7
tellapplication"Capture One 21" tellapplication"System Events" tell process "Capture One 21" UI elements of group 1of window "Capture One Catalog" endtell endtell endtell
输出:
1
{scroll area 1 of group 1 of window "Capture One Catalog" of application process "Capture One 21" of application "System Events"}
查看应用里面的属性(在 apple script 里面,一个应用实际上会映射为
apple script 里面的一个对象,就是 application xx 这是一个
apple script 对象)
1 2 3 4 5 6
tellapplication"Capture One 20"toset a toit
tellapplication"Capture One 20" get properties -- 获取 "Capture One 20" 的属性 get properties of viewer of a -- 获取 "Capture One 20" 里面的 viewer 里面的属性 endtell