Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jsmm/7128473 to your computer and use it in GitHub Desktop.
Save jsmm/7128473 to your computer and use it in GitHub Desktop.
The AppleScript code is the following:
--2011-03-25
--http://organognosi.blogspot.com
tell application id "com.devon-technologies.thinkpro2"
set these_items to the selection
if these_items is {} then error "Please select some contents."
repeat with this_item in these_items
set RecordLink to the reference URL of this_item
set DevonThinkLink to RecordLink & "?page=0"
set PdfPath to get the path of this_item
set PdfName to the name of this_item
tell application "Skim"
open PdfPath
set docPath to path of front document
set notesPath to text 1 thru -5 of docPath & " (notes).skim"
save front document
save front document in notesPath as "Skim notes"
delete notes of front document
tell page 1 of document 1
make note with properties {type:anchored note, bounds:{523, 820, 540, 820}, text:"(<rawtex></rawtex>: [" & RecordLink & "?page=])", extended text:DevonThinkLink}
delay 0.1
make note with properties {type:anchored note, bounds:{523, 800, 540, 800}, text:"(: \\href{" & RecordLink & "?page=}{})"}
delay 0.1
make note with properties {type:anchored note, bounds:{523, 780, 540, 780}, text:"([[" & PdfName & "]]: [" & RecordLink & "?page=])"}
delay 0.1
make note with properties {type:anchored note, bounds:{523, 760, 540, 760}, text:DevonThinkLink, extended text:PdfName}
delay 0.1
make note with properties {type:anchored note, bounds:{523, 760, 540, 760}, text:"0"}
end tell
read notes front document from notesPath without replacing
end tell
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment