Skip to content

Instantly share code, notes, and snippets.

@fuxialexander
Last active September 17, 2020 16:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuxialexander/58cb959be746990443ce952bdedf3f26 to your computer and use it in GitHub Desktop.
Save fuxialexander/58cb959be746990443ce952bdedf3f26 to your computer and use it in GitHub Desktop.
tell application "Skim"
set thedoc to the front document
set anno to the active note of thedoc
set newtext to text of anno
set startpoint to (offset of "org-id:{" in newtext) + 8
set endpoint to (offset of "}:org-id" in newtext) - 1
if (startpoint - 8 is not equal to endpoint + 1) and (endpoint + 1 is not 0) then
set orgid to characters startpoint thru endpoint of newtext as string
do shell script "/usr/local/bin/emacsclient -n -e \"(progn (org-id-goto \\\"" & orgid & "\\\") (x-focus-frame (selected-frame)) (evil-exit-visual-state))\""
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment