"Get bookmark from active window" doesn't work as expected in Apple Shortcuts

I have an Apple M1 on Sequoia 15.5 and am using Shortcuts 7.0 to automate using Hookmark to copy and format text and present a markdown link.

This roughly looks like:

  1. Get bookmark from active window
  2. If it’s an actual bookmark (isBookmark = 1), then
  3. grab the url and title from the bookmark
  4. copy selected text (if any)
  5. Use regex to format the title and text
  6. Present a markdown link text - title

The issue is that Get Bookmark from Active Window doesn’t seem to provide a usable bookmark with the expected fields. My workaround (pictured below) is to copy a link to the clipboard from the bookmark then retrieve it again.

However, it turns out that having to pre-populate the clipboard like this messes up my automation in the case that I don’t select text in Skim PDF but still want to format the title (because Skim doesn’t allow Cmd+c if no text is selected, unlike Safari). Otherwise, it works fine in Safari and in Skim with text selected.

How is Get bookmark from active window supposed to work? If I choose to Focus on the bookmark it creates, it does what I expect, but I can’t seem to access title/url in any way other than exploiting the clipboard.

Welcome to Hookmark forum, @sbrjct .

I tried “Get variable …” and “Set variable…” actions. After that, accessing the title and URL of the bookmark is allowed. Could you please give it a try?

Thank you

That worked! Thank you! Though, ultimately, I think I’ll go with Keyboard Maestro for automation I think this is still good to know.