Last active
September 17, 2020 16:08
-
-
Save fuxialexander/58cb959be746990443ce952bdedf3f26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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