Acrobat DC actions run in applescript or automator

Hi all,


Is this possible to run the action file created in Acrobat DC pro using Applescript or Automator app. I have tried using Applescript invoked with menus and not able to invoke the action toolbar.

MacBook Pro (2020 and later)

Posted on Apr 16, 2021 8:30 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 23, 2021 4:49 AM

Hi Vijay

I don't think this is possible with Applescript. The scripting support for Acrobat was deplorable 10 years ago when I wrote about GUI scripting in Acrobat (https://macgrunt.com/2011/10/25/gui-scripting-acrobat/). And it looks like it has not improved at all in that time.


You got your script to open the Action Wizard from the menu. But the resulting UI is not recognised by Applescript.

You can see this by running:

tell application "System Events"

tell process "Acrobat Pro DC"

return UI elements

end tell

end tell


You'll see that the only UIs recognised are 'window' and 'menu bar 1'

Menu bar 1 is the one you addressed in your script, so no help there.


If you run: return UI elements of window 1

You'll find that nothing useful is returned.


Applescript just does not recognise the Action Wizard as a scriptable interface.


m.



8 replies
Question marked as Top-ranking reply

Apr 23, 2021 4:49 AM in response to Vijay_Yukthi

Hi Vijay

I don't think this is possible with Applescript. The scripting support for Acrobat was deplorable 10 years ago when I wrote about GUI scripting in Acrobat (https://macgrunt.com/2011/10/25/gui-scripting-acrobat/). And it looks like it has not improved at all in that time.


You got your script to open the Action Wizard from the menu. But the resulting UI is not recognised by Applescript.

You can see this by running:

tell application "System Events"

tell process "Acrobat Pro DC"

return UI elements

end tell

end tell


You'll see that the only UIs recognised are 'window' and 'menu bar 1'

Menu bar 1 is the one you addressed in your script, so no help there.


If you run: return UI elements of window 1

You'll find that nothing useful is returned.


Applescript just does not recognise the Action Wizard as a scriptable interface.


m.



Apr 16, 2021 11:27 AM in response to Vijay_Yukthi

You need to look at Acrobat DC Pro's AppleScript dictionary to see what commands it understands. From there you can work out how (if at all) it's possible to invoke an action file.


I don't have Acrobat DC Pro to be able to test, but start off by running Script Editor.app, choosing 'Open Dictionary...' from the File menu, and selecting the Acrobat DC Pro application. This will give you an idea of what's possible. Post the data here if you need help deciphering it.

Apr 23, 2021 5:01 AM in response to aussie macgrunt

Further to this ...

Your accessibility Inspector shows a bunch of nested groups (with empty descriptions)

If you run: return UI elements of window 1

You'll see that one of the elements is a group. But you can't dig any further down than that.

Because if you run: return UI elements of group 1 of window 1

You'll see that you get '{}' – an empty list.

As far as Applescript is concerned, there's nothing there.


m.

Apr 18, 2021 1:48 AM in response to Camelot

Thanks Camelot for your response,


I have referred the Acrobat DC pro AppleScript Dictionary but there is no option over there. I have tried with below code access the menu in acrobat dc it working fine.


tell application "System Events"

tell application process "Acrobat Pro DC"

set frontmost to true

click the menu item "Action Wizard" of menu 1 of menu item "Tools" of the menu "View" of menu bar 1

end tell

end tell


But not able to select and click the below toolbar and the options in the acrobat dc using apple script. Could any help me to resolve this.




Apr 23, 2021 9:14 AM in response to aussie macgrunt

Thanks Macgrunt,


Now I got it. My actual requirement is to run the OCR in acrobat dc through automation i.e., Applescript or Javascript. I have analysed in detail there is more chances in Applescript itself compare to javascript.


For that only I have created the OCR as action in acrobat DC and try to execute via apple script using menus. As u mentioned, I have go up to Action Wizard from the menus, but I can't get into the toolbar to click the action.


Is there is possibilities to use a UI Browser for monitor and convert the action into applescript?



Please share your thoughts if any possibilities over here to done this job is much appreciated...



Thanks

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Acrobat DC actions run in applescript or automator

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.