Activating JavaScript in Acrobat's JS Console

I'm writing a macro to open Adobe Acrobat Pro's JavaScript Console, paste in a block of JavaScript, and activate it. The macro is able to open the console, paste in the code, and highlight it. The last step is to hit CMD-Return to activate the code. The macro is not able to do this. The issue isn't that the console window is not at the front since, if I run the macro, which gets me to this step.....

...and then hit CMD-Return manually, the script executes. To confirm this is the problem, I got to that step, and tried to activate CMD-Return using this simple macro:

Pressing OPT-B does nothing, but pressing CMD-Return directly does activate the script.

image

Return and Enter are different keys, so that might be your issue.

It is also possible that the application is detecting the physical state of the keys, or detecting the modifier state at a later time. You could try:

Thanks for your quick reply. I tried your approach and it unfortunately didn't work. I opened the console and highlighted the code. I then ran the macro using OPT-B a couple of times, and nothing happened. But when I pressed CMD-Return manually, the code activated. Here is the revised macro:

image

Note: The reason it changed from this:


to this:

...is that I wanted to ensure that it wasn't failing because it thought it was no longer in Acrobat when using the Java console. So I moved it to a less restrictive macro group (all apps except a few specfically designated). But I found that made no difference.

And sorry for the Return/Enter ambiguity. I corrected that in my original post. That wasn't the issue, since both my manual action and my Macro were, consistently, doing CMD-Return.

I see I should not have been using the terms interchangeably, since Enter appears to mean SHIFT-Return:

image