What is this script supposed to do? It contains multiple errors.
In general you would need to use Apple Script to execute Java Script in Safari, e.g.
tell application "Safari"
Or if you are on Monterey you can use the Shortcuts app to create such an action (which can then be called from BTT):
I'm trialling a cloud bookmark facility so that my bookmarks are available across devices and different browsers. The one I'm using is Bookmark Ninja https://www.bookmarkninja.com
The code I posted relates to one of the bookmarklets which, when clicked, will add a bookmark to my Bookmark Ninja dashboard in the tab and category I select. In other words it acts like Cmd-D that you use to add a bookmark in your local browser. It works perfectly as a bookmarklet but I have to have the bookmarks bar showing in order to use it. I'd like to hide the bar and use the touch bar to initiate the action.
It's not a big deal and I'm not that much of a real estate freak that I have to hide the bookmarks bar but, if it was easy, then I'd put it on the touch bar.
BTT is indispensable to me for so many reasons but if the coding skills to make it work with this are beyond me, which they undoubtedly are, I won't lose much sleep.
Hey there Andreas,
When trying to make it into an Apple script however, I keep getting some silly errors. Here's one example:
On MacOS Ventura (unfortunately) and using it with Firefox so shortcuts doesn't provide anything for Firefox.
What does the bookmarklet do? Just clips selected text and imports it into Obsidian. It works fine in the browser, but difficulty with BTT.
Thanks in advance.
Other method I tried? The one below complies fine with no errors, but when activated (via a click of a touchbar button)...nothing happens.
(I shortened the script just to keep this comment short here in the forum, it's much longer but you get the gist of it I think)
tell application "Firefox"
clipthis in front window