First, I want to thank the Skim developers and Christiaan for  
restoring (some of) the AppleScript functionality with 1.1.4. I've  
been trying to decouple the saving of Skim notes from the saving of  
the PDF and AppleScript is the only way to do it short of changing the  
application source code. I have larger reasons for wanting this  
functionality, but that's not the point of this post.

Before I get to business, however, I want to give a bit of background.  
I am a humanities scholar (literary and cultural studies, mostly  
American postmodernism) and I fell in love with Skim way back at 0.3 I  
think. Because of many of the PDFs I deal with are digital versions of  
very long books, navigation of these long texts sometimes proved  
cumbersome. I also use PDFs while teaching, eschewing handling paper  
bound volumes which cannot be marked up without damaging them and  
whose annotations are not machine-searchable.

Long PDFs are not so much a problem if I am lecturing, but in  
discussion with a need to move quickly between different pages because  
discussants are using paper print copies, I sometimes found myself at  
a loss. To this end, I have concocted a very simple AppleScript that  
asks for a page number and an increment value. When run, the script  
will tell Skim to number all the pages of the frontmost document  
starting at the user-provided page number and in increments also  
supplied by the user. The page numbers appear in the lower left of the  
PDF pages.

Undoubtedly, this script could be improved and I look forward to  
anything folks might provide. What follows is the script. I hope some  
of you find it useful.

Cheers,

Johnnie Wilcox
---------------------

set pageNumber to ""
repeat while pageNumber is ""
        display dialog "Starting Page:" default answer pageNumber
        set pageNumber to text returned of result
end repeat
set pageIncrement to ""
repeat while pageIncrement is ""
        display dialog "Increment Pages by:" default answer pageIncrement
        set pageIncrement to text returned of result
end repeat
set thisPage to 1
try
        tell application "Skim"
                set numPages to number of pages of front document
                repeat until thisPage is equal to numPages + 1
                        tell page thisPage of front document
                                make note with properties {type:text note, 
text:"--Page " &  
pageNumber & "--", bounds:{50, 100, 125, 80}, line width:2, line  
style:solid line, color:{61680, 52942, 50115, 65535}}
                        end tell
                        set thisPage to thisPage + 1
                        set pageNumber to pageNumber + pageIncrement
                end repeat
        end tell
on error
        display dialog "Skim could not number the pages of the front document"
end try 

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to