
我在应用程序脚本字典中看到了要修改的属性。它位于一个类中,但我找不到修改它的方法。有没有办法修改它?
我尝试了以下方法,但得到一个错误:
tell application "Capture One 21"
activate
set image location of next capture options to "/tmp"
end tell输出:
error "Can’t set «class viil» of «class CncO» to \"/tmp\"." number -10006 from «class viil» of «class CncO» to «class /tmp»错误代码-10006表示“写入操作被拒绝”。
当我使用get image location of next capture options尝试获取此配置时,我也得到了一个错误:
tell application "Capture One 20"
activate
get image location of next capture options
end tell输出:
error "Can’t get image location of next capture options." number -1728 from «class viil» of «class CncO»-1728表示“引用的对象不存在”,但我使用的是pro版本。

发布于 2021-10-20 05:51:57
谢谢你的帮助,@Robert Kniazidis。使用Script Debugger,我发现实际的设置项不是next capture options,而是next capture settings,而且它位于document下,因此获得此配置值的实际方法是get image location of next capture settings of document 1。但最终它真的无法设置,因为需要企业版。

最后,我找到了一种方法来模拟和操作UI元素,以达到我想要的效果:
tell application "Capture One 20"
activate
end tell
tell application "System Events"
tell process "Capture One 20"
click radio button 2 of radio group 1 of window 1
delay 0.1
global destination
set destination to 0
repeat with g in every group of window 1
repeat with sa in every scroll area of g
if exists of group "NextCaptureLocation" of sa then
set nextCaptureLocation to group "NextCaptureLocation" of sa
if exists of group "目的地" of nextCaptureLocation then
set destination to group "目的地" of nextCaptureLocation
end if
if exists of group "Destination" of nextCaptureLocation then
set destination to group "Destination" of nextCaptureLocation
end if
end if
end repeat
end repeat
if destination = 0 then
display notification "Cannot obtain target element Destination" with title "AppleScript Error"
return
end if
click pop up button 1 of destination
click menu item -1 of menu 1 of pop up button 1 of destination
delay 1
key code 5 using {shift down, command down}
delay 1
key code 0 using {command down} -- command + A
key code 51
delay 1
set the clipboard to "/tmp"
key code 9 using {command down} -- command + v
delay 1
keystroke return
delay 1
keystroke return
end tell
end tellhttps://stackoverflow.com/questions/69624261
复制相似问题