Created
January 17, 2014 16:50
-
-
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.
This file contains 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
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