When I run this simple JSX directly in Adobe Illustrator it works fine and the selection is maintained.
But when it is run through KM the selection is lost after the Illustrator Action is run. Why the difference?
Running it via a "Simulated Keystroke" works fine from KM, but I would prefer to call it by name because Illustrator Action Keystrokes can be easily changed or lost.
@carycrusiau, Thank you! That solved it. I like the directness of Applescript from KM. I just seem to find more resources for Javascript. Guess I'll be learning more Applescript.
Personally, I prefer JavaScript to AppleScript. Just a matter of taste. But I use both. I usually save my JSX files in a Dropbox folder then I simply use an Execute AppleScript inside Keyboard Maestro:
Yes, that's what I've been doing in most cases (I think I learned that from you). In this case I was wanting direct access to edit the script in KM. The Applescript does that for me.
Ultimately I would like to eliminate AI Actions completely, from our workflow. There are just some things I don't know how to handle directly in a script… yet.