2011/04/02

Go to the written page number of a PDF document

In my previous post "Latin page numbers, Arabic page numbers and the fifth Skim note" I described the logic behind the number in the fifth note. Now we can use this information in order to go to the written page number of a PDF document without doing any calculations. This proves quite convenient especially in the case of academic papers in which the written numbers are totally out of sync with the page numbers which are given by Skim.

The AppleScript which performs this function is the following:

--2011-04-02
--http://organognosi.blogspot.com

tell application "Skim"
    display dialog "Give the written page number:" default answer "" buttons {"Cancel", "OK"} default button 2
    set writtenNumber to text returned of the result as integer
   
    set numberNote5 to (get text for note 5 of page 1 of document 1)
    set numberInThePDF to writtenNumber - numberNote5
    go document 1 to page numberInThePDF of document 1
end tell


No comments: