Skip to content

Instantly share code, notes, and snippets.

@epramono
Created January 17, 2014 15:55
Show Gist options
  • Save epramono/8475787 to your computer and use it in GitHub Desktop.
Save epramono/8475787 to your computer and use it in GitHub Desktop.
This AppleScript will accept `begin <todo-item>` in Alfred and translate it to x-callback-url invocation on iOS - involving Command-C and Begin. Requires: Alfred 2 + Power Pack, Command-C 1.0, and Begin.
tell application "System Events"
set theDevice to my urlencode("Eric Pramono’s iPhone") as string
set theQuery to my urlencode("{query}") as string
set theURL to "command-c://x-callback-url/copyText?deviceName=" & theDevice & "&text=beginapp%3A%2F%2Fx-callback-url%2FaddTasks%3Ftext%3D" & my urlencode(theQuery)
open location theURL
end tell
on urlencode(theurl)
return do shell script "php -r 'echo rawurlencode(\"" & theurl & "\");'"
end urlencode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment