It parses all 1Password files and creates 1Click bookmarks in Camino, which then are indexed by LaunchBar.
Cmd-Space, a couple of keystrokes and... boom! You are automagically logged in!

To use the script:
* install Camino
* save the script as 1P-to-Camino.scpt and run it
* add Camino Bookmarks to LaunchBar (LaunchBar Index > "+" > Web Bookmarks > Camino)
* optionally, you may want to schedule 1P-to-Camino.scpt to run periodically (e.g. http://www.tuaw.com/2008/04/14/mac-101- ... r-scripts/)
Code: Select all
-- Using the default keychain location. Change this line if necessary.
property OnePassKeychain : (path to home folder as string) & "Library:Application Support:1Password:1Password.agilekeychain:data:default:"
-- This tag will be appended to the end of bookmark names. Change this line if necessary.
property OnePassTag : " (1P)"
property BookmarkURLStart : "\"location\":\""
property BookmarkNameStart : "\"title\":\""
property UUIDStart : "\"UUID\":\""
property ItemEnd : "\",\""
property AlternateItemEnd : "\"}"
property IsWebForm : "webforms.WebForm"
property IsTrashed : "\"trashed\":true"
-- a handler that parses values from 1Password files
on ParseValue(ValueName, DelimiterName, DataFile)
set AppleScript's text item delimiters to {DelimiterName}
set ValueName to text item 2 of DataFile
set AppleScript's text item delimiters to {ItemEnd}
set ValueName to text item 1 of ValueName
if ValueName contains {AlternateItemEnd} then
set AppleScript's text item delimiters to {AlternateItemEnd}
set ValueName to text item 1 of ValueName
end if
return ValueName
end ParseValue
-- a handler that makes a bookmark URL
to MakeURL(BookmarkURL, UUID)
if BookmarkURL contains "?" then
set BookmarkURL to BookmarkURL & "&onepasswdfill=" & UUID
else
set BookmarkURL to BookmarkURL & "?onepasswdfill=" & UUID
end if
return BookmarkURL
end MakeURL
-- a handler that makes bookmarks in Camino
to MakeBookmark(BookmarkName, BookmarkURL)
tell application "Camino"
tell bookmark folder "1Password"
make new bookmark with properties {name:BookmarkName, URL:BookmarkURL}
end tell
end tell
end MakeBookmark
-- deleting and recreating the 1Password folder in Camino
tell application "Camino"
if exists bookmark folder "1Password" then
delete bookmark folder "1Password"
end if
make new bookmark folder with properties {name:"1Password"}
end tell
tell application "Finder"
set PassFolder to OnePassKeychain as alias
set PassFileList to every file in PassFolder whose name ends with ".1password"
repeat with i from 1 to number of items in PassFileList
set PassFile to (read (item i of PassFileList as alias))
if PassFile contains IsWebForm and PassFile does not contain IsTrashed then
set BookmarkURL to ParseValue("BookmarkURL", BookmarkURLStart, PassFile) of me
set BookmarkName to ParseValue("BookmarkName", BookmarkNameStart, PassFile) of me
set UUID to ParseValue("UUID", UUIDStart, PassFile) of me
set BookmarkURL to MakeURL(BookmarkURL, UUID) of me
MakeBookmark(BookmarkName & OnePassTag, BookmarkURL) of me
end if
end repeat
end tell
tell application "Camino" to quit
Change log:
2010-01-15
* Added property OnePassKeychain for easy customization of the 1Password Keychain location.
* Added property OnePassTag to be appended to the end of bookmark names.
* Added a condition to exclude trashed logins.