Hello,

I use a little handler to extract all highlight notes from my Skim document per 
page. However, the notes on any page will not be sorted by the order they are 
on the page but by time created. Has anyone done anything similar and knows how 
to sort them by order on the page? They are sorted in that order in the GUI so 
I assume it must be possible. I also noticed they are sorted in appearance 
order when exporting the notes to a text file, but I don't want all these 
"Highlight page X" headings and keep them grouped by page, which is the purpose 
of this script.

Here is the handler:

on exportSkimNotes(theSkimDocument)
        set theSkimNotes to {}
        
        tell application "Skim"
                
                open theSkimDocument
                set theSkimDocumentForSkim to the result
                
                set numberOfPages to count pages of theSkimDocumentForSkim
                repeat with currentPage from 1 to numberOfPages
                        set pageNotes to {}
                        set currentPDFpage to page currentPage of 
theSkimDocumentForSkim
                        set pageNotes to notes of page currentPage of 
theSkimDocumentForSkim
                        if pageNotes is not {} then set theSkimNotes to 
theSkimNotes & my implode("", {"Page " & currentPage & ":"})
                        repeat with i from 1 to count of pageNotes
                                set theSkimNote to item i of pageNotes
                                set theSkimNote to (get text for theSkimNote) 
as string
                                set theSkimNotes to theSkimNotes & theSkimNote
                        end repeat
                        set pageNotes to {}
                end repeat
                set numberOfPages to {}
                
                save theSkimDocumentForSkim
                
                close theSkimDocumentForSkim
                
                return theSkimNotes
                
        end tell
end exportSkimNotes 

For anyone wanting to try or use this handler, it should be noted that the 
implode  handler in my script behaves roughly like the one that can be found 
here: http://applescript.bratis-lover.net/library/string/ 

Cheers,

Jan
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to