Forked from fractaledmind/Insert Markdown Links for current Skim page (Custom URL)
Last active
January 21, 2018 20:23
-
-
Save derickfay/6455739 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
(* COPY CURRENT PAGE OF SKIM PDF TO CLIPBOARD | |
-- created by Stephen Margheim | |
-- 06 July 2013 | |
-- open source | |
edits by Derick Fay 2013-09-05: | |
-- edited to use clipboard | |
-- optimized for Alfred workflow to bypass Reference/Inline dialog box | |
-- 2013-09-11 modified to just add (page) and paste | |
-- 2014-08-22 switched from calling this from an Alfred workflow to a TextExpander snippet | |
*) | |
tell application "Skim" | |
(* PART ONE: | |
Choose your Link | |
*) | |
set number_of_Note3 to (get text for note 3 of page 1 of front document) as string | |
set LinkType to 1 | |
(* PART TWO: | |
Insert your Chosen Link | |
*) | |
tell document 1 | |
--get Skim p# | |
set notePage to get index of current page | |
--get p# printed on the pdf (requires you to manually alter Note 3) | |
set theRealPage to notePage + number_of_Note3 as string | |
set FinalText to "(" & theRealPage & ")" | |
set the clipboard to FinalText | |
tell application "System Events" | |
(* delay 0.5 *) | |
keystroke "v" using {command down} | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now running this from a text expander snippet