Jump to content

Chrome Bookmark Search Workflow


Recommended Posts

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

A workflow to allow you to search Chrome Bookmarks and open them when actioned in Chrome.   I originally posted these on my Tumblr but I've since noticed a few issues with it so I fixed a few things

All - I saw this posted on Twitter and personally I like this solution a lot better than a Chrome workflow. It uses a utility called Brow to make Chrome and Firefox bookmarks searchable in Spotlight:

Actually, I was looking to make it so I could browse a specific folder of bookmarks, but no others. I've adapted David's workflow for my own purposes (imported that folder of bookmarks into Chrome, an

Yeah that's something that I think we really should try to standardize across workflows is not starting some searches until a minimum string length is reached. Think about some people with a HUGE amount of Chrome bookmarks or something. It keeps things from slowing down. A minimum string length definitely needs to be used for script filters pulling data from the net

Link to post

It may be updating the database. The way it currently runs is.. it checks the last mod time of the database file. If it's changed since the last time the extension ran then it truncates the contents of the database and reloads them all. If you have a lot of bookmarks, it may be taking a second to load them back up. Just a thought?

Link to post

Thanks for this: it's very useful. I'm running Chromium, but with a couple of changes it works well.

One hiccup: it doesn't seem to like bookmarks in Japanese. Seems like any bookmark with a Unicode reference for a double-byte character in the "name" field of a Chrome bookmark gets junked in the database and doesn't show up in searches. For example, the Bookmarks record below doesn't get picked up (even though the name contains some non-Japanese text):

 

{
            "date_added": "12988168872055591",
            "id": "73",
            "name": "goo \u5927\u76F8\u64B2",
            "type": "url",
            "url": "http://sumo.goo.ne.jp/"
         }

 

Could this have something to do with the SQLite database encoding?

[edit]…or maybe not: I just had a look at the database in the Firefox SQLite Manager, and the Japanese looks fine.

Edited by Chris Ryal
Link to post
It may be updating the database. The way it currently runs is.. it checks the last mod time of the database file. If it's changed since the last time the extension ran then it truncates the contents of the database and reloads them all. If you have a lot of bookmarks, it may be taking a second to load them back up. Just a thought?

 

I've waited quite a bit and it never worked afterwards. I don't feel like I have all that many bookmarks as I store most things in Pinboard. As a workaround I've been deleting the .db file every so often. Kind of a pain though. Also - do you have any idea why Safari bookmarks no longer open in the default browser anymore like they did in Alfred v. 1? Seems Safari is the only option in "Open with" now too.

Link to post

I may have to find another way to make it locate the chrome bookmarks file. I was trying to make it link directly to where the file should be but foreign languages are making that difficult because the file structure is diff. I may have to do a rewrite of this workflow to make it work for the users with foreign languages. I also accidentally included a database file that had MY path saved in it originally so people had to delete the bookmarks.db file to get it to work.

Link to post
  • 4 weeks later...

I'm getting the following warning ahead of the XML which seems to cause me not to get any results:

 

 

Warning: SQLite3::exec(): near "This": syntax error in /Users/bmiller/Dropbox/Home/Library/Alfred2/Alfred.alfredpreferences/workflows/user.workflow.8771B37D-3EFC-4FD5-AC1F-C7135CFD2E90/extension_utils.php on line 269
<?xml version="1.0"?>
<......
Link to post
  • 2 weeks later...
  • 2 weeks later...

This is great!!

 

I the search algorithm is not very good though (not sure whether that is Alfred or the workflow). Below are a couple of screenshots.

 

1) Alfred "ch new" finds the new york times page  http://postimage.org/image/475xpczff/

2) Alfred "ch new " does not find the new york times page  http://postimage.org/image/3s37c238z/

3) Alfred "ch newt" does not find the new york times page http://postimage.org/image/whi74jw4n/

4) Alfred "ch nyt" does not find the page either http://postimage.org/image/cn8n0bhg1/bfc6a68a/

 

I think they should all find the page...

Link to post

This is great!!

 

I the search algorithm is not very good though (not sure whether that is Alfred or the workflow). Below are a couple of screenshots.

 

1) Alfred "ch new" finds the new york times page  http://postimage.org/image/475xpczff/

2) Alfred "ch new " does not find the new york times page  http://postimage.org/image/3s37c238z/

3) Alfred "ch newt" does not find the new york times page http://postimage.org/image/whi74jw4n/

4) Alfred "ch nyt" does not find the page either http://postimage.org/image/cn8n0bhg1/bfc6a68a/

 

I think they should all find the page...

 

You are correct. I have a few things I need to update on it but have been stretched out lately trying to keep up with support stuff. I'll add it to my notes and try to get an update pushed out soon.

 

Thanks

Link to post
  • 3 weeks later...

This works sketchy for me. It doesn't find all my bookmarks, especially any new ones I've added since installing this, though it could be coincidentally as I've deleted the db file and same results.

 

It finds some, not others basically and I've typed the exact match.

Link to post

Hi David,

 

I found this workflow not working well when there is Chinese characters (or other utf-8 characters) in title. A tweak by changing line 66 in bookmarks.php:

 

'title' => htmlentities( $match->name ),

 

to

 

'title' => htmlentities( $match->name, ENT_QUOTES, "utf-8" ),

 

will solve the problem.

Link to post

Hi David,

 

I found this workflow not working well when there is Chinese characters (or other utf-8 characters) in title. A tweak by changing line 66 in bookmarks.php:

 

'title' => htmlentities( $match->name ),

 

to

 

'title' => htmlentities( $match->name, ENT_QUOTES, "utf-8" ),

 

will solve the problem.

 

 

I don't even see that entry anywhere in the file. I searched for 'title' and it returned nothing. Here's what I have on line 66 (do I have a different workflow installed??):

 

http://cl.ly/image/3c390s1b0444

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...