Jump to content

Bookmark content search


Recommended Posts

Hi all,

 

Spotlight has the ability to not only search for the title of a Safari bookmark, but also the content. Is there a way to do this in Alfred3?

 

What I mean by this is lets say that I've titled my bookmark "A3" and the content is "https://www.alfredapp.com". I'd like to be able to search for "alfred", and get a hit for "https://www.alfredapp.com" in bookmarks, as opposed to having to remember the name of the title.

 

Thanks.

Link to post

Dude,

 

No way! You just made this for me!? You're AWESOME.

 

Thank you so much. It works perfectly. I was just looking at the script and trying to understand exactly what and how it works, but it's not making sense to me exactly. I'd love to be able to write my own workflows.

Link to post
58 minutes ago, BigTrees said:

No way! You just made this for me!? You're AWESOME.

 

It only took a few minutes.

 

58 minutes ago, BigTrees said:

I was just looking at the script and trying to understand exactly what and how it works, but it's not making sense to me exactly. I'd love to be able to write my own workflows.

 

There's no script per se. It's just Alfred's built-in File Filter function.

 

I just went to ~/Library/Caches/Metadata/Safari/Bookmarks (where Safari exports its bookmarks, and history), dragged one of the .webbookmark files to the File Types field, dragged the directory itself to the Search Scope, and—here's the trick—added kMDItemURL to the Fields list in the Advanced tab.

 

(I ran the mdls command on one of the bookmark files to find the metadata field I needed.)

Link to post
47 minutes ago, deanishe said:

 

It only took a few minutes.

 

 

There's no script per se. It's just Alfred's built-in File Filter function.

 

I just went to ~/Library/Caches/Metadata/Safari/Bookmarks (where Safari exports its bookmarks, and history), dragged one of the .webbookmark files to the File Types field, dragged the directory itself to the Search Scope, and—here's the trick—added kMDItemURL to the Fields list in the Advanced tab.

 

(I ran the mdls command on one of the bookmark files to find the metadata field I needed.)

 

Awesome! I just learned a few things. I wasn't familiar with the mdls command, and now I am. Sweet. I'll poke around in the File Filter shortly, to get a better understanding of what it does.

 

Thanks again!

 

Link to post

@BigTrees Further to what others have already suggested, I thought I'd point you to a few more resources...

 

Guide to creating your own file filter:

https://www.alfredapp.com/help/workflows/inputs/file-filter/#workflow

 

And built into Alfred's workflows, you'll find under the + button at the bottom of the sidebar, a wide range of examples (around 60 examples and templates).

 

Take a look at Examples > Simple Folder Search for a file filter that specifically searches for folders, and the Dynamic File Search, which again uses the File Filter object to first set the search scope, then search within that location.

 

You can customise the File Filter object

 

* in Basic setup, you can drag in file types you want to search

* in Search Scope, you can drag in the folders you want to search

* in Advanced, you can specify which fields should be searched (e.g. as per deanishe's workflow, you can add the URL to the search fields)

 

Any of the above are optional, so you may only set the file types, or only the scope for some workflows.

 

That's just one of the many powerful objects you can use in Alfred! Don't hesitate to ask for help when you want to create your own workflows - and if you're part-way through creating one, be sure to share it when asking the question. It'll make it much easier for anyone to guide you in the right direction :)

 

Cheers,
Vero

Link to post
  • 4 months later...

I think one big problem (and it's the reason Alfred added the direct bookmark search feature) is that starting with macOS High Sierra, Safari bookmark metadata is no longer indexed.

 

So I would like to request Alfred to add the ability to index Safari bookmark URLs as well as titles.

 

-Eric

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...