Running an Illustrator Action through KM?

I often include Adobe Illustrator Actions in KM Macros either by way of a Simulated Keystroke or by running a Javascript that runs the Action by name.

When I run the Action via Script (through KM) the result loses the current selection (not expected). However, if I run it via Simulated Keystroke it works as expected (selection remains).

I found if I run the Javascript directly from Illustrator the selection remains as expected. So, what is different about running it from KM?

The simple solution is to run it via Simulated Keystroke. The downside is Illustrator Action Shortcuts can easily be changed or deleted, breaking the macro.

I'd much prefer to run AI Actions by name if I can make them run the SAME as using a Keystroke.

Here are some test files if someone has an interest in this:

Do Action "Unite" (AI).kmmacros (4.3 KB)

Here is the AI Action file that is called:

1 Like

Hey @rcraighead,

I use Illustrator every day, but am new to KM.

This was very helpful to me, even though I am having the same issue as you.
My workaround is enough for me. It opens the Pathfinder window, and moves the mouse over "Unite" without losing selected shapes. All I have to do is click the mouse after using the hot key. I will build a bit on this and see how it works.

Thanks for the inspiration!

1 Like

Glad you found a solution. I seem to have found the balance. These scripts have been working for a year now. I've learned a lot more about Javascript as well, so that may have something to do with it.

Good to have another AI user in the KM forum. We can keep learning together.

1 Like