Jump to content

Copy title and url of bookmark


Recommended Posts

I love that I can search bookmarks in alfred natively! I discovered that I can copy the url of the bookmark to clipboard by just using CTRL-C.

 

Now I am hoping to create a workflow to copy the bookmark's TITLE AND URL to clipboard. Whether in markdown format, or formatted as a rich text link, or just A and then B. 

 

How do i access the bookmark's title to be able to accomplish this?

Link to comment
On 5/2/2021 at 4:47 AM, lehcar3 said:

How do i access the bookmark's title to be able to accomplish this?

 

You can't. Alfred's built-in bookmark feature only supports searching and opening bookmarks.

 

If you want to do something more exotic, like copy Markdown or RTF links, you'll need to use a workflow. There's doubtless one that can read your browser's bookmarks.

Link to comment

Thanks @deanishe. I searched all day on Saturday and could not find what I was looking for -- There are many that do the link formatting that I want, but it's all the active browser tab, rather than referencing bookmarks. And in fact, I would probably not be using this workflow while IN the browser, I would normally be using it in Omnifocus. I wasn't sure how to modify those workflows (that do the url/title part I'm looking for) to be referencing a queried bookmark. 

 

I wasn't sure if my approach should be to combine something like this: http://www.packal.org/workflow/chrome-bookmarks-0 with something like this: https://github.com/esanai/lazylink and at what exact point should they be combined.

 

What I'm stuck on is that one part is a script filter (the querying I want to do in alfred) and then another one is running a script (making the link). It's almost like a file action...but not on a file?

 

Edit:

 

The lazylink script works because, in the active browser, it defines link title as document.title. In my browser bookmarks file, the title and link are "name" and "url" in a json object. So I think I would need a script filter that searches the bookmarks file, like the one I linked above. And then run a script that parses out the json title and url and then formats that into a link (which lazylink has). I feel like I'm so close!

 

 

 

Screen Shot 2021-05-04 at 9.51.25 AM.jpg

Edited by lehcar3
more information gathered!
Link to comment
5 hours ago, lehcar3 said:

I wasn't sure if my approach should be to combine something like this: http://www.packal.org/workflow/chrome-bookmarks-0 with something like this: https://github.com/esanai/lazylink and at what exact point should they be combined.

 

You need to alter a chrome workflow to output the URL and the title, and adapt that "lazylink" script to accept a URL and title (either on the command line or via environment variables).

 

What kind of Mac do you have? Intel or M1?

Link to comment

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