jdfwarrior Posted January 15, 2013 Share Posted January 15, 2013 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 and wanted to post it here so people could comment or report issues. http://d.pr/f/gkwy drking, thec13 and slappy 3 Link to comment
xchukx Posted January 15, 2013 Share Posted January 15, 2013 Thanks David, works great Link to comment
Filoumino Posted January 15, 2013 Share Posted January 15, 2013 Yeah, now it's working here, too.But you need to type at least 3 letters to get som suggestions, right?!Something Alfred-related won't show up until you've entered at least 'alf'. Link to comment
jdfwarrior Posted January 15, 2013 Author Share Posted January 15, 2013 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 comment
Jb_Bryant Posted January 15, 2013 Share Posted January 15, 2013 Actually I have to type 6 characters for some of my bookmarks. Any idea why that would be? I've only noticed it on one I have labeled "Quicklinks". Nothing shows up until I get to the "l". Link to comment
Jb_Bryant Posted January 15, 2013 Share Posted January 15, 2013 Seems to have stopped working on me. Had to delete the .db file for it to start working again. Link to comment
jdfwarrior Posted January 15, 2013 Author Share Posted January 15, 2013 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 comment
Chris Ryal Posted January 16, 2013 Share Posted January 16, 2013 (edited) 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 January 16, 2013 by Chris Ryal Link to comment
Jb_Bryant Posted January 16, 2013 Share Posted January 16, 2013 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 comment
Florian Posted January 17, 2013 Share Posted January 17, 2013 I can't get it to work. Is there some setting up to do or something? I just get "unable to locate your bookmarks file"... Link to comment
jdfwarrior Posted January 17, 2013 Author Share Posted January 17, 2013 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 comment
Jb_Bryant Posted February 13, 2013 Share Posted February 13, 2013 Make any headway on this by chance? The workflow doesn't work at all for me anymore, even after I delete the .db file. Link to comment
bnmnetp Posted February 20, 2013 Share Posted February 20, 2013 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 comment
GamerChase Posted March 6, 2013 Share Posted March 6, 2013 Is it possible to do this for Safari? Link to comment
Jb_Bryant Posted March 6, 2013 Share Posted March 6, 2013 Is it possible to do this for Safari? Safari bookmarks are built into Alfred. Even in version 1. No need for a workflow. Turn that on here: http://cl.ly/image/2d3i1p390q2h Link to comment
GamerChase Posted March 6, 2013 Share Posted March 6, 2013 Safari bookmarks are built into Alfred. Even in version 1. No need for a workflow. Turn that on here: http://cl.ly/image/2d3i1p390q2h *facepalm* Of course. Clearly I need more coffee this morning. Thank you. Link to comment
GamerChase Posted March 6, 2013 Share Posted March 6, 2013 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, and load in Safari with the modified keyword), and it does precisely what I wanted. It's here, if you're interested. mercoby 1 Link to comment
bocaboy Posted March 16, 2013 Share Posted March 16, 2013 Outstanding, and seriously useful! Link to comment
greghoch Posted March 16, 2013 Share Posted March 16, 2013 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 comment
jdfwarrior Posted March 16, 2013 Author Share Posted March 16, 2013 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 slappy 1 Link to comment
LiamW Posted March 31, 2013 Share Posted March 31, 2013 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 comment
Jb_Bryant Posted April 4, 2013 Share Posted April 4, 2013 I personally think you should revert the workflow to the matching algorithm it used before. I can't stand how matching works now. Anyways, I added in a fallback search option to the workflow if anyone is interested: http://cl.ly/1X1z1f211f1L jaspalx 1 Link to comment
lucifr Posted April 5, 2013 Share Posted April 5, 2013 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 comment
Jb_Bryant Posted April 5, 2013 Share Posted April 5, 2013 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 comment
lucifr Posted April 6, 2013 Share Posted April 6, 2013 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 Sorry I didn't read through all the replies. I was referring to David's original one: http://d.pr/f/gkwy Yours works well with utf-8, thx. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now