Jump to content
BigTrees

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.

Share this post


Link to post

You mean the URL?

 

You can't search the URL via Alfred's default results, but you can with a File Filter by also specifying the kMDItemURL metadata field.

 

Here's a workflow.

Share this post


Link to post

Hi Deanishe,

 

I saw your workflow earlier when I searched the topic, before posting, and though about downloading it.

 

Thanks, I'll check it out.

Share this post


Link to post

If you found my unpublished Safari Assistant workflow, that isn't the same thing.

 

The workflow I just posted was made especially for you. 

 

The other one doesn't search URLs. 

Share this post


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.

Share this post


Link to post
1 minute ago, vitor said:

 

Alfred’s documentation is extensive and helpful. You can do a lot with Workflows without even needing to code.

 

I checked it out a while ago, and unfortunately not much of it made sense to me, and I used to code. ? Maybe I need video instructions, with lots of explanations. ?

 

I'll dive into it again.

 

Thanks!

Share this post


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

Share this post


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!

 

Share this post


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

Share this post


Link to post

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

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...