How to extract each tab's name of Foxit Reader with ACC?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
valuex
Posts: 86
Joined: 01 Nov 2014, 08:17

How to extract each tab's name of Foxit Reader with ACC?

08 Feb 2020, 08:52

Foxit Reader is a great pdf reader.
And I am trying to extract each tab's name of Foxit Reader with ACC, so that I can have a list of the opened file.
The following is what I've tried, but not work.
The problem is probably due to line 14, which is:

Code: Select all

oAcc := Acc_Get("Object", "1", 0, "ahk_id " hCtl)
Here the object id seems can't be obtained by acc_viewer.
Any coments? Thanks.

Code: Select all

#include ACC.ahk
F1::
WinGet, hWnd, ID, A
WinGetActiveTitle, aTitle
vCount := 0
WinGet, vCtlList, ControlList, % "ahk_id " hWnd
WinGet, hWnd, ID,  ahk_class  classFoxitReader
Loop, Parse, vCtlList, `n
{
	vCtlClassNN := A_LoopField
	if (SubStr(vCtlClassNN, 1, 10) = "BCGPTabWnd")
     {    
          ControlGet, hCtl, Hwnd,, %vCtlClassNN%, % "ahk_id " hWnd
          oAcc := Acc_Get("Object", "1", 0, "ahk_id " hCtl)
          vText := oAcc.accName(0)
          MsgBox %vCtlClassNN% -- %vText% -- %hCtl%--%OutputVar%
     }
}
Return
wbm1113
Posts: 18
Joined: 28 Aug 2018, 11:19

Re: How to extract each tab's name of Foxit Reader with ACC?

08 Feb 2020, 11:43

You only use "ahk_id" when the following two criteria are met:

1. You are using a built-in AHK function with a 'WinTitle' parameter
2. You are specifying to that WinTitle parameter that you are passing a handle, not a string

The following line doesn't meet either of those criteria. It is not a built-in AHK function and you are not passing a 'WinTitle' parameter. Unless whoever authored the library is using built-in AHK syntax for their functions, which would be very awkward.

Code: Select all

oAcc := Acc_Get("Object", "1", 0, "ahk_id " hCtl) ; take out the ahk_id

Code: Select all

oAcc := Acc_Get("Object", "1", 0, hCtl)
valuex
Posts: 86
Joined: 01 Nov 2014, 08:17

Re: How to extract each tab's name of Foxit Reader with ACC?

09 Feb 2020, 08:27

I figure it out.
The AccOject Path is as following, which can be obtained by using JEE_AccGetTextAll
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=40615

Code: Select all

AccPath:="4.5.4." . TabNum . ".4" ; obtained by using JEE_AccGetTextAll
tabs := Acc_Get("Object", AccPath, 0, "ahk_id " hWnd)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 338 guests