Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jsmm/7129046 to your computer and use it in GitHub Desktop.
Save jsmm/7129046 to your computer and use it in GitHub Desktop.
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
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
save document 1
delay 1
close document 1
end tell
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment