Scripting Acrobat Pro

I am hoping someone knows how to script Acrobat Pro.

I am trying to find what page in the frontmost PDF the user is looking at.

The following script finds out the name of Window 1 (which is frontmost)

tell application "System Events" to tell process "AdobeAcrobat" to set wndw to get name of window 1

This script gets the page number being viewed of Window 1

tell application "Adobe Acrobat Pro"
	get page number of PDF Window 1
end tell

Unfortunately, Window 1 in the second script is not the same as Window 1 in the first script. So I can find the page number of the PDF being viewed in Window 1 of Acrobat but I cannot be sure that Window 1 in that scenario is the window at the front being currently viewed.

Anyone have any suggestions to solve this?

Many thanks

try this


tell application "Adobe Acrobat Professional"
	get page number of PDF Window 1 of active doc
end tell

Just worked out this

tell application "Adobe Acrobat Pro"
	get page number of PDF Window of active doc
	--get active doc
end tell

Which does the trick.

Same as Stefank :slight_smile: (or almost)

Many thanks