Read the Tree text of whatever has focus (in Adobe Acrobat) Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
asghar5676
Posts: 12
Joined: 22 Aug 2017, 01:24

Read the Tree text of whatever has focus (in Adobe Acrobat)

08 Aug 2018, 19:35

Hi all,

I have a tree in Adobe acrobat which contains the name of the fields. I would like to get the text of focused item. See screenshot below:

Image

In this case, for instance, I would like to get "EndYearManager20"

And FYI, here is what I get in window spy:

Image

Can someone kindly help? :eh:
colt
Posts: 54
Joined: 04 Aug 2014, 23:12
Location: Portland Oregon

Re: Read the Tree text of whatever has focus (in Adobe Acrobat)

09 Aug 2018, 16:57

Can you post a sample pdf?
colt
Posts: 54
Joined: 04 Aug 2014, 23:12
Location: Portland Oregon

Re: Read the Tree text of whatever has focus (in Adobe Acrobat)  Topic is solved

09 Aug 2018, 17:43

Try this. It's kinda hacky but works great on my computer.

Code: [Select all] [Download] GeSHi © Codebox Plus

f6::
send {AppsKey}R
controlGetText,text,edit1,A
send {esc}
tooltip %text%
return
asghar5676
Posts: 12
Joined: 22 Aug 2017, 01:24

Re: Read the Tree text of whatever has focus (in Adobe Acrobat)

14 Aug 2018, 22:27

colt wrote:Try this. It's kinda hacky but works great on my computer.

Code: [Select all] [Download] GeSHi © Codebox Plus

f6::
send {AppsKey}R
controlGetText,text,edit1,A
send {esc}
tooltip %text%
return



Thanks for the help. It did the job. :clap:
Just for learning purposes, what is 'edit1' in your code?

I am asking because now I need to get to JavaScript for that feild and I am struggling to find a shortcut key for that. Do you perhaps know any trick about getting to item no.2 in picture below?

Image
colt
Posts: 54
Joined: 04 Aug 2014, 23:12
Location: Portland Oregon

Re: Read the Tree text of whatever has focus (in Adobe Acrobat)

15 Aug 2018, 00:23

I put some sleeps in there to slow it down so you can see what it is actually doing. The edit1 is the control name of a field that becomes temporarily visible after pushing the apps key. I then grabbed the text from the control before dismissing it with escape. The original code is so fast that it doesn't even have time to render the edit box before escape is called.

Code: [Select all] [Download] GeSHi © Codebox Plus

f6::
send {AppsKey}
sleep 500
send R
; a new control is now available that autohotkey can see, windows spy shows edit1 as its control name.
controlGetText,text,edit1,A
sleep 500
send {esc}
tooltip %text%
return


As for navigating the new window I can no longer help as much because I was running a 7 day trial of adobe acrobat. Do the controls show up as anything useful in windows spy? If not, try to come up with a set of keystrokes that navigate the window to put the javascript on the clipboard. Then you can use autohotkey to automate those keystrokes with some degree of reliability.

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 18 guests