Copy link to clipboard
Copied
So I know how to script a menu command from the menu bar, but is there a way to run a command from a panel menu?
Here is an example of a menu command:
tell application "System Events" to tell process "Illustrator"
click menu item "Unlock All" of menu 1 of menu bar item "Object" of menu bar 1
end tell
Ideally I'd like to "Add Used Colors" from the Swatches panel menu.
Is there a...
click menu item "Add Used Colors" of "Swatches" menu
...or something like that?
Maybe this isn't a System Event, but an Illustrator command, but I don't see anything in the dictionary for it.
Any help would be appreciated!
1 Correct answer
Hello @Fobioid,
I don't think there's a app.executeMenuCommand to Add Used Colors from the swatches panel.
What you could do is record/create a action that "Add Used Colors" then you can execute the action with the script below. You'll need to plug in the name of your action and the name of the set it resides in.
app.doScript("Name of Action", "Name of Action Set")
Regards,
Mike
Explore related tutorials & articles
Copy link to clipboard
Copied
Hello @Fobioid,
I don't think there's a app.executeMenuCommand to Add Used Colors from the swatches panel.
What you could do is record/create a action that "Add Used Colors" then you can execute the action with the script below. You'll need to plug in the name of your action and the name of the set it resides in.
app.doScript("Name of Action", "Name of Action Set")
Regards,
Mike

