On Oct 23, 2012, at 12:19, Jan Jakob Bornheim wrote: > I could, but the context of the handler is that is part of an AppleScript > that compares an Evernote notebook and a bib File. If the PDF connected with > the entry of the bib file is annotated, it should export the annotations and > store them to the annote field for the bib entry or the main text field of > the Evernote note. > > I guess I could prepare a template, use "format using template" in the > AppleScript (although I have not yet figured out how that command works) on > the PDF and then read the content of the resulting file again but I feel like > that might become a performance issue when reading 300 PDFs in a row. > > The beauty of the AppleScript handler was that everything will be stored in > RAM until the resulting bib file gets written. > > Cheers, > > Jan
Well, using a template and letting the program parse it is much more efficient than passing along a long bunch of AppleScript events. Also, you can use templates purely in memory also from AppleScript. Christiaan > > On 2012-10-23, at 12:04 PM, Christiaan Hofman <[email protected]> wrote: > >> This can be done much more easily and more customizable using export >> templates (see the WIki). >> >> Christiaan >> >> On Oct 23, 2012, at 11:47, Jan Jakob Bornheim wrote: >> >>> 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 >> >> >> ------------------------------------------------------------------------------ >> 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 > > > ------------------------------------------------------------------------------ > 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 ------------------------------------------------------------------------------ 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
