Any way to automate InMath in InDesign

In Math is a plug in for InDesign. When I want to use it I have to select my text, then click on an InMath style in the InMath palette. InMath does not (and according to some, will not) provide quick keys functionality for this.

Wondering if I can run a simple applescript for this. I know you can script “unscriptable” programs, but what about plugins?

“Scripting the unscriptable” is the domain of UI scripting. The only way to know if this is going to work before beating your head against it too much is to see if something like Prefab’s UI Browser can “see” the palette. If it can give you property info for it (like a window name), then you might be able to UI script it.

I say “might” because not all applications behave as you’d expect. A good example is Lotus Notes, which has a bad habit of showing the user one interface, but on the backend doing something else, which makes UI scripting nigh-on impossible, or at least a horrible exercise in frustration.

Second issue is that floating palettes don’t seem to follow normal UI conventions to select/click them, in my experience. So even if you can do something like “on the inMath pallette” you might not be able to “select the style named Fraction” or even a basic “select the second style.”

Which leads me to the third gotcha. It may be very likely if you can get this far that you can’t select the style by name, but only by ID or position in a list (i.e. “the second style”), which means you or your users cannot add, delete, or otherwise get the one you want to select “out of order” from what the script expects.

NOW, given all the gloom-n-doom above, you can always try. I swore I’d never get Lotus Notes to script, but after some patience and head-banging, I did finally figure out how to get around the interface using keyboard shortcuts, tabs, shift-tabs, and other keyboard-robatics and make it jump through the hoops I wanted it too.