Target Front Document in Acrobat 6

'Morning!

I need to get information from the frontmost document open in Acrobat. As a test I have:

tell application "Acrobat 6.0.2 Professional" to set initTitle to get info of front document key "Title" as string
display dialog initTitle

With two documents open, this always grabs the Title of document 1 no matter which document is in front. Using “document 1” or “document 2” does differentiate between the two documents.

OK folks, what did I do wrong? :confused:

Thanks,

T.

trinkel,

I’ve not scripted Acrobat but this is the solution I found for getting the title info. Hope it helps.

tell application "Acrobat 6.0.2 Professional"
	set initTitle to name of front document
	display dialog initTitle
end tell

PreTech

PreTech

When I tried that script, it still returned the information from Acrobat’s document 1, not the frontmost document in Acrobat.

FYI (but I don’t think it has anything to do with the original issue):
I have to use the “get info” routine because the actual file name on these files is database garbage from our workflow system. The real document name which I want to use as the file name when I save is only in the title field of the document properties.

Any other ideas out there?

T.

I think I found it - in Acrobat’s AS dictionary of all places - DOH!

Instead of “front document”, or even “document of front window”, you need “active doc”:

tell application "Acrobat 6.0.2 Professional" to set initTitle to get info of active doc key "Title" as string
display dialog initTitle

If anyone comes up with something better, I’m still open to suggestions.

T.