Created
April 23, 2017 07:08
-
-
Save freklov/7d6431de31f918e5f972b61645771d9a to your computer and use it in GitHub Desktop.
AppleScript for Things: Copy internal URL of Evernote Note and make a todo in Things with Quick Entry
This file contains hidden or 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
-- create automator service | |
-- Drag & Drop "Actions:Utilities:Run AppleScript" into service | |
-- | |
-- Services receives: no input | |
-- in "Evernote.app" | |
-- copy and paste the AppleScript commands into action | |
on run {input, parameters} | |
-- get name and link of selected note | |
-- only process first selected note | |
tell application "Evernote" | |
activate | |
set selectedNotes to selection | |
set theNote to first item of selectedNotes | |
set theTitle to title of theNote as text | |
set theLink to note link of theNote | |
end tell | |
-- execute global Things keystroke ctrl+space (Quick Entry) | |
tell application "System Events" to keystroke space using {control down} | |
tell application "Things" | |
activate | |
-- set name of to do to title of note | |
-- then jump to notes field | |
set the clipboard to theTitle | |
delay 0.5 | |
tell application "System Events" | |
keystroke "v" using {command down} | |
keystroke tab | |
keystroke tab | |
end tell | |
-- set notes to url link of evernote | |
-- then jump back to name of todo | |
set the clipboard to theLink | |
delay 0.5 | |
tell application "System Events" | |
keystroke "v" using {command down} | |
keystroke tab using {shift down} | |
keystroke tab using {shift down} | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment