Applescript / Javascript > Adobe Acrobat scripting

Applescript Mouse Click Help?

(1/1)

Star123:
Hi Guys,

I am using Mac OS X Yosemite, Apple Script Editor – Version 2.7 and Adobe Acrobat XI.

I would like to go the respective Tag for the Current Selection in the Tag Panel.

So Far What I doing is,
1. Selecting Text
2. Clicking Option Button in Tag Panel and
3. Clicking “Find Tag From Selection” from the list.

As of Now I am using the below script. But it take more time to click.


--- Code: ---
tell application "Adobe Acrobat Pro"
   activate
   set x to 50
   set y to 180
   
   do shell script "
/usr/bin/python <<END
import sys
import time
from Quartz.CoreGraphics import *
def mouseEvent(type, posx, posy):
theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
CGEventPost(kCGHIDEventTap, theEvent)
def mousemove(posx,posy):
mouseEvent(kCGEventMouseMoved, posx,posy);
def mouseclick(posx,posy):
mouseEvent(kCGEventLeftMouseDown, posx,posy);
mouseEvent(kCGEventLeftMouseUp, posx,posy);
ourEvent = CGEventCreate(None);
currentpos=CGEventGetLocation(ourEvent); # Save current mouse position
mouseclick(" & x & "," & y & ");
mousemove(int(currentpos.x),int(currentpos.y)); # Restore mouse position
END"


set x to 50
set y to 310

do shell script "
/usr/bin/python <<END
import sys
import time
from Quartz.CoreGraphics import *
def mouseEvent(type, posx, posy):
theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
CGEventPost(kCGHIDEventTap, theEvent)
def mousemove(posx,posy):
mouseEvent(kCGEventMouseMoved, posx,posy);
def mouseclick(posx,posy):
mouseEvent(kCGEventLeftMouseDown, posx,posy);
mouseEvent(kCGEventLeftMouseUp, posx,posy);
ourEvent = CGEventCreate(None);
currentpos=CGEventGetLocation(ourEvent); # Save current mouse position
mouseclick(" & x & "," & y & ");
mousemove(int(currentpos.x),int(currentpos.y)); # Restore mouse position
END"

end tell

--- End code ---

By Applescript or Javascript, Can it possible to Click “Find Tag From Selection” on the Tag Panel?


Any Help would be appreciated.


Thanks,
Mathew

Jean-Marie Schwartz:
Hi!

Acrobat is not very Applescript-friendly.
One way is to use UI Browser.app (from http://pfiddlesoft.com/uibrowser/) and try to isolate the button you wish in one way or another via UI scripting.
HTH.

Benevides:
There should still theoretically be a way to do this in Applescript though, no?

Navigation

[0] Message Index

Go to full version