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:
In this case, for instance, I would like to get "EndYearManager20"
And FYI, here is what I get in window spy:
Can someone kindly help?
Read the Tree text of whatever has focus (in Adobe Acrobat) Topic is solved
-
- Posts: 18
- Joined: 22 Aug 2017, 01:24
Re: Read the Tree text of whatever has focus (in Adobe Acrobat)
Can you post a sample pdf?
Re: Read the Tree text of whatever has focus (in Adobe Acrobat) Topic is solved
Try this. It's kinda hacky but works great on my computer.
Code: Select all
f6::
send {AppsKey}R
controlGetText,text,edit1,A
send {esc}
tooltip %text%
return
-
- Posts: 18
- Joined: 22 Aug 2017, 01:24
Re: Read the Tree text of whatever has focus (in Adobe Acrobat)
colt wrote:Try this. It's kinda hacky but works great on my computer.Code: Select all
f6:: send {AppsKey}R controlGetText,text,edit1,A send {esc} tooltip %text% return
Thanks for the help. It did the job.
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?
Re: Read the Tree text of whatever has focus (in Adobe Acrobat)
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.
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.
Code: Select all
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