Skip to content

Instantly share code, notes, and snippets.

@epramono
Created January 17, 2014 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epramono/8476835 to your computer and use it in GitHub Desktop.
Save epramono/8476835 to your computer and use it in GitHub Desktop.
This AppleScript will accept `1pbrowse` in Alfred and open the current active tab in Safari on 1Password's browser for iOS. Requires: Alfred 2 + Power Pack, Command-C 1.0, and 1Password 4.
set theActiveURL to ""
tell application "Safari"
set theActiveWindow to first window
set theActiveTab to current tab of theActiveWindow
set theDecodedURL to URL of theActiveTab as string
set theActiveURL to my urlencode(theDecodedURL) as string
end tell
tell application "System Events"
set theDevice to my urlencode("Eric Pramono’s iPhone") as string
set theURL to "command-c://x-callback-url/copyText?deviceName=" & theDevice & "&text=op" & theActiveURL
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