In my case, I read mostly technical manuals. I’m often jumping pages a lot with the spacebar.
If I want to move 2 pages forward because one is intentionally blank, for example, there’s no guarantee how many spacebar keys that takes due to zoom level, and I don’t end up at the top of the desired page.
If I could do a Cmd+Opt+Shift+P then type +2 in the box, that would be clean, easy and very useful.
-- Go to PDF page +/- relative
tell application id "DNtp"
try
if not (exists think window 1) then return
set theRecord to content record of think window 1
if theRecord = missing value then return
set theRecord_Type to (type of theRecord) as string
if theRecord_Type is in {"PDF document", "«constant ****pdf »"} then
activate
set thePageOffset to display name editor "Go to PDF page +/- relative"
set theCurrentPage to (current page of think window 1) + 1
set theDestinationPage to theCurrentPage + thePageOffset
set theRecord_PageCount to page count of theRecord
if theDestinationPage < 0 then
set theDestinationPage to 1
else if theDestinationPage > theRecord_PageCount then
set theDestinationPage to theRecord_PageCount
end if
do shell script "open " & quoted form of ((reference URL of theRecord) & "?page=" & (theDestinationPage - 1))
end if
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
return
end try
end tell
And that will make the script much simpler (requires of course the next release):
tell application id "DNtp"
try
if not (exists think window 1) then return
set theWindow to think window 1
set theRecord to content record of theWindow
if theRecord is not missing value and type of theRecord is PDF document then
set thePageOffset to display name editor "Go to PDF page +/- relative"
set current page of theWindow to (current page of theWindow) + (thePageOffset as integer)
end if
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell