Script to save user styles
I am trying to write a script that will save user styles automatically. However, I am running into an issue. When I try to access the menu bar, I get an invalid index error. The code works if I run it as a standalone script, but if I import into Capture One for use from the menu bar, it gives the error. Any ideas what I am doing wrong?
Here is the chunk of code that is not working:
on run argv
…
tell application "System Events"
tell process "Capture One"
click menu item 2 of menu 1 of menu item 19 of menu 1 of menu bar item 6 of menu bar 1
end tell
end tell
…
end run
Here is the chunk of code that is not working:
on run argv
…
tell application "System Events"
tell process "Capture One"
click menu item 2 of menu 1 of menu item 19 of menu 1 of menu bar item 6 of menu bar 1
end tell
end tell
…
end run
0
-
Why not just backup style from C1 Application setting, as this is much simpler? 0 -
Thanks for your response. I am not trying to backup the styles. What I am trying to do is create custom styles- the menu bar item in Capture One is called "Save User Style...". I looked in the AppleScript dictionary for Capture One and could find no way to save a style other than GUI scripting it. I want the process to be automated so that I only have to start the script and let it handle the rest. My script will create the names for the styles for me so that ideally I do not need to interact with the dialog windows at all. 0
Post is closed for comments.
Comments
2 comments