First steps with Browser Actions

A few weeks ago, I posted a small shortcut that creates an Obsidian note from a webpage. You can find it here: Save a webpage in Obsidian

One issue I encountered was that this shortcut only worked on iOS/iPadOS due to a bug in the Mac Shortcut implementation related to the Article Object.

With the TestFlight version of “Browser Actions,” my initial task was to recreate this shortcut now for MacOS. This still needs some fine-tuning, but it’s already functional.

In some cases, the conversion from HTML to formatted text to markdown results in some strange formatting, such as when markdown expressions for code (```) are not interpreted very well. However, this appears to be a problem with Apple’s implementation and affects neither “Browser Action” nor “Actions for Obsidian.”

Nice. Cool idea, combining Make Rich Text from HTML and Make Markdown from Rich Text!

On my todo list is adding an additional, cleaned-up document to the page details. Needs more research first.

Thanks!

Hello,

Here’s the next version of my little showcase. The major improvement over the initial version is its ability to create notes in Safari, Google Chrome, and Brave without the need for specific routines tailored to each browser. Adding support for any missing browsers is straightforward, following the example AppleScript code.

I encountered some challenges with the user interface of the Shortcuts app. Sometimes the editor behaves erratically when editing or deleting variables or expressions. I also found the visual layout a bit unwieldy when working with the nested if statements. Consequently, I decided to shift all of this to the AppleScript portion, as I had to use AppleScript anyway to fetch the name of the frontmost app (I couldn’t find anything other that worked on the web). Perhaps there’s a more elegant solution out there, but this was the path I took.

With the “Get details to the tab” function, the browser name is added in square brackets to the webpage’s name. I initially thought this might cause issues when using it in the filename, so I used a regex statement to remove the browser name and brackets. However, I’ve since realized that it’s translated to “- Browsername -”, so I’ve removed that statement.

@czottmann, I had the choice of getting either pure text or HTML as the result. I opted for the latter to preserve formatting. Because I failed to convert the HTML direct to markdown I go this way. Other ways might be using pandoc or other libraries. But for the moment I’m fine. May be for crating a bookmark page with a preview, I would love to get additional fields., like excerpt, author and an article images (just as ideas for future development).

Nevertheless, I need to broaden my explorations and find a use for the “Browser Action” that isn’t related to Obsidian, allowing me to test the other features as well.

Here is the shortcut: