Skip to content

Instantly share code, notes, and snippets.

@epramono
Created January 17, 2014 16:33
Show Gist options
  • Save epramono/8476485 to your computer and use it in GitHub Desktop.
Save epramono/8476485 to your computer and use it in GitHub Desktop.
This AppleScript will accept `journal <item>` in Alfred and translate it to x-callback-url invocation on iOS - involving Command-C and 1Writer. Requires: Alfred 2 + Power Pack, Command-C 1.0, and 1Writer 1.2
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=drafts%3A%2F%2Fx-callback-url%2Fcreate%3FafterSuccess%3DDelete%26action%3DAdd%2520Journal%2520Item%2520in%25201Writer%26text%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