Hi folks,
i don’t know if i did anything wrong, but the getPageNo() function did’t work for me ( i think in the 1st version i always got the wrong page number) so i had to alter it.
In the current version, the result of this function (without my change) is always empty for me.
Today i read sth. of “better pdf reader support” in the release notes and so i did the update and also updated the hook scripts for pdfExpert (manually, like c&p). But after that, linking didn’t work anymore…
First, i realized that if i have an open finder window, it didn’t work at all (i also get an error if trying to run the script in script editor with an already open finder window).
When i have no open finder window, it works only for the whole pdf (no deep linking possible).
Then i remembered that i changed the getPageNo() function - and after i changed this function again (in the Get-Address script), deep-linking in pdf expert works again (also with open finder windows…).
In case someone has problems with the original script version maybe it is worth a try
Dont use it if everthing works
The changed getPageNo() function is kind of (ugly) slow, because it has to open and interact with one window of pdf Expert to copy the current page number to clipboard…
changed getPageNo() function (was used in the old version of get address posted by lawyerboy)
on getPageNo()
try
tell application "System Events"
tell process "PDF Expert"
set frontmost to true
click menu item "Go to Page..." of menu 1 of menu bar item "Go" of menu bar 1
click menu item "Copy" of menu 1 of menu bar item "Edit" of menu bar 1
tell application "System Events" to key code 53
set pageText to the clipboard
end tell
end tell
return pageText
on error
return ""
end try
end getPageNo
changed getPageDetails() function (used in new version of get address posted by lawyerboy)
i didn’t look into why the var pageLabel is used - just did enough change to make it working for me again
on getPageDetails()
set {pageNo, pageLabel} to {missing value, missing value}
try --Get the details we need
tell application "System Events" to tell process "PDF Expert"
set frontmost to true
click menu item "Go to Page..." of menu 1 of menu bar item "Go" of menu bar 1
click menu item "Copy" of menu 1 of menu bar item "Edit" of menu bar 1
tell application "System Events" to key code 53
set pageNo to the clipboard
set pageLabel to the clipboard
end tell
end try
return {pageNo, pageLabel}
end getPageDetails