Thursday, September 20, 2018

#1 2018-07-09 05:42:20 am

johnmathew
Member
Registered: 2009-10-12
Posts: 88

Adobe Acrobat Pro XI Mouse Click

Hi Guys,

I am using Mac OS X "Yosemite" - Version 10.10.5, Adobe Acrobat Pro XI - Version XI, Script Editor - Version 2.7.

I would like to make a mouse click in the Option Button of Tag Panel in Acrobat XI.
After a long Googling I get the below script which describes UI Elements, Groups, Button, Radio Button etc., of the Application Window.

Googled Script

Applescript:


tell application "Adobe Acrobat Pro"
   activate
   set allButtons to {}
   
   tell application "System Events"
       tell process "Acrobat"
           with timeout of 0 seconds
               set tElements to entire contents of window 1
           end timeout
           
           repeat with i in tElements
               if class of i is button then set end of allButtons to contents of i
           end repeat
       end tell
   end tell
end tell

The Below line are which I need.

Applescript:


get class of menu button "Options" of group 2 of group 2 of group 1 of group 1 of window "ABC" of application process "AdobeAcrobat"
       --> menu button

How to make Mouse Click on this Option Button?

After Clicking the Option Button, I would like click in the pop up window.

Thanking You
Mathews

Last edited by johnmathew (2018-07-09 05:46:00 am)

Offline

 

#2 2018-08-07 11:22:53 am

t.spoon
Member
From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 298

Re: Adobe Acrobat Pro XI Mouse Click

I'm on the latest version of Acrobat from CC, which I think is very different, so I'm having trouble trying to look at this myself.

You want to drill down through the UI to find the syntax to address the button you need, and then clicking it is as simple as writing "click it."

There are 4 main ways I know of to find the right syntax to get to that button -

1. Use Accessibility Inspector, free but included with X-Code, which is a big download, and in my experience occasionally provides wonky info. There's someone providing a stand-alone download here, but I can't vouch for the quality of the source:
https://forum.keyboardmaestro.com/t/os- … pting/3443
2. Use UI Browser, which was made for exactly this, costs money, but has a free trial:
https://pfiddlesoft.com/uibrowser/
3. Use Script Debugger, which allows you to browse UI hierarchies, but for some programs, it can't extract data unless the program is in front. It's also paid, but has a free trial:
https://latenightsw.com/
4. Use Script Editor to drill down.
ie:

Applescript:

tell application "System Events"
   tell application process "AdobeAcrobat"
       set UI1 to every UI element
   end tell
end tell
return UI1

result:

{window "Acrobat Pro DC" of application process "AdobeAcrobat", menu bar 1 of application process "AdobeAcrobat"}



next step, look inside an element:

Applescript:

tell application "System Events"
   tell application process "AdobeAcrobat"
       set UI2 to every UI element of window "Acrobat Pro DC"
   end tell
end tell
return UI2

result:

{group 1 of window "Acrobat Pro DC" of application process "AdobeAcrobat", button 1 of window "Acrobat Pro DC" of application process "AdobeAcrobat", button 2 of window "Acrobat Pro DC" of application process "AdobeAcrobat", button 3 of window "Acrobat Pro DC" of application process "AdobeAcrobat", static text "Acrobat Pro DC" of window "Acrobat Pro DC" of application process "AdobeAcrobat"}



And keep modifying your script drilling down through the elements until you find that "options" button.

Then just do a nested "tell" all the way to that element, ending in a "click it."

Last edited by t.spoon (2018-08-07 11:24:39 am)


Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)