I haven't been able to figure out where LaunchBar is looking for the 1Password bookmarks. I tried copying and soft-linking the 1Password subdirectories in my Containers directory to various places in ~/Library/Application Support, but refreshing the 1Password Bookmarks indexing rule never found any bookmarks.
I've finally given up and written a quick perl script to extract the bookmarks from the bookmarks-default.json file and write a bookmarks file that I added to LB's indexing rules as a "Custom HTML Bookmarks File...". This JSON to HTML conversion script probably exists elsewhere but I couldn't find it.
Note sure if this will help anybody, as you'll need to at least:
Use at your own peril, it's a quick hack...
I've finally given up and written a quick perl script to extract the bookmarks from the bookmarks-default.json file and write a bookmarks file that I added to LB's indexing rules as a "Custom HTML Bookmarks File...". This JSON to HTML conversion script probably exists elsewhere but I couldn't find it.
Note sure if this will help anybody, as you'll need to at least:
- install JSON::Parse with `sudo cpan -i JSON::Parse`
- Modify the script in line 3 to point to your 1Password container directory. I found mine by clicking on the "Show Files" button in the backups tab of the 1Password preferences.
- Put the script someplace like ~/Library/Scripts. The output file ('1p-bookmarks.html') will appear there, and you'll need to point LaunchBar to that file when you add the Custom HTML Bookmarks File.
- Make the file executable (`chmod +x convert-1P-bookmarks-to-LB.pl`) and run it to generate the bookmarks file. Refresh (or add if you haven't already) the indexing rule in LB.
- You'll need to re-teach LB all of your abbreviations, since these are new rules to LB.
Use at your own peril, it's a quick hack...
- #!/usr/bin/env perl -w
use JSON::Parse 'json_file_to_perl';
my $p = json_file_to_perl ("/Users/rdonle/Library/Containers/7BUWWDC4S2C.com.agilebits.onepassword-osx-helper/Data/Library/3rd\ Party\ Integration/bookmarks-default.json");
die "File not specified or unparseable." unless $p;
my $outfile = '1p-bookmarks.html';
open(my $fh, '>', $outfile) or die "Could not open file '$outfile' $!";
print $fh <<EOF;
!DOCTYPE NETSCAPE-Bookmark-file-1>
<HTML>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<Title>1Password Bookmarks</Title>
<H1>Bookmarks</H1>
EOF
foreach my $row (@$p) {
my $name = @$row[1];
my $url = @$row[2];
$url = "http://$url" unless $url =~ m/^https?:\/\//i;
print "Adding $name ($url)...\n";
print $fh "<A HREF=\"$url\">$name</A>\n";
}
print $fh "</HTML>\n";
close $fh;
print "Done.\n";