Skip to content

Instantly share code, notes, and snippets.

@freklov
Created April 23, 2017 07:08
Show Gist options
  • Save freklov/7d6431de31f918e5f972b61645771d9a to your computer and use it in GitHub Desktop.
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
-- 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