Applescript/javascript to run a panel menu command in Illustrator
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!
