Hook integration for Apple Freeform. Added support for Muse

Hook integration with the new Apple Freeform app would be very nice. I know Apple is not particularly keen to allow their apps to provide link integration. But, I can dream…

6 Likes

Bump to that - first thing I tried was to link to Craft but nope.

1 Like

Welcome to the Hookmark Forum @MartinJ and @djaneb. And thanks for asking about that.

Apple’s Freeform app has no automation yet. No AppleScript dictionary and not even Apple Shortcuts automation. So there is no possibility for any software / automation (whether Hookmark or other) to index or access it. Also, it does not yet offer a URL scheme.

Apple has shown very little interest in providing links in its software. For instance, Apple Notes and Apple Messages have no links.

Apple Mail and Apple Notes have no explicit URL scheme, however the Manifesto for Ubiquitous Linking does not strictly require software to provide a URL scheme. The more general idea is that software needs to provide robust indexes ( identifiers) and that can also be used for retrieval.

As such CogSci Apps has developed hook:// URL schemes for Apple Notes and Apple Mail which software like Hookmark can leverage (registering as URL-handlers for it on iPhone, iPad and macOS).

We will happily do something similar for Freeform if/when it has adequate automation.

IDs and search

We @ CogSci Apps are committed to rounding out as many use cases of linking as possible. As such in my Cognitive Productivity with macOS: 7 Principles for Getting Smarter with Knowledge (if I correctly recall !) I, and on this website from 2019 onwards here we, have published a general purpose way of linking anything, even if it has no automation and no URLs.

The trick is to generate a unique ID (using Hookmark’s Copy a New Unique ID or other method) and paste it in the item. Then you use that ID in hyperlinks or other notes. you later feed the ID in search manually, or using hook://search/ links. Currently hook://search/ links leverage Spotlight which by default only finds files. But we intend to generalize that. We recommend using the hook://search/ links for now, and feeding them into manual or automated workflows.

So if /when Freeform gets indexed by Spotlight users will be able to access them with these links.

3 Likes

Thank you for this explanation.

1 Like

Hello,
I am interested in creating bidirectional links for an app that allows me to freely place text and images on a wide canvas. I have tried Muse (https://museapp.com/), but Hookmark resulted in “No linkable Item found.”

Is the method you’ve described above also applicable to Muse? I am not confident that it will work, as the target is not a simple text file like the example of the editor at Gear Menu – Hookmark, and I think the written IDs will not be searchable via Spotlight.

If it can be used, I would be happy to purchase the Pro license (I cannot test it since I noticed this after the free trial period has expired).

1 Like

I figured out a way to copy Freeform links. Basically

  1. use the share feature,
  2. copy the link from there.
  3. Focus on Link in Clipboard
  4. rename in clipboard.

from there you have a meaningful bookmark that you can manipulate.

I’ll explain more soon, perhaps will do a quick video.

It shouldn’t require so many steps, but Apple has not yet signed onto the Manifesto for Ubiquitous Linking. Hopefully they will announce this at WWDC, and make all their apps link-friendly.

5 Likes

Welcome to the Hookmark Forum , @motoso , and also to everyone who is new to the forum that I might have missed welcoming.

I haven’t used Muse. One of us here will (or a forum member could) have a look at whether it has an AppleScript dictionary to give us the information we need.

Otherwise there is

I have been experimenting with this.

When Freeform is synced, I can copy the shared URL. Step #3 doesn’t seem to exist after that. The Focus item has no option for it.

I can use the url to open the board, however.

I can’t see what I missed.

You can find it under Gear button menu:

Thank you

1 Like

Thank you very much!

We just added support for Muse. Sorry it take us a while to get it done.

It is based on UI scripting because Muse does not have AppleScript support. So sometimes you might need try one more time.

The fix is in script version 294. You can get it via Hookmark preferences->Update->Check now.

Thank you

1 Like

Something seems to have broken over time for Muse.
When I invoke Hookmark, Muse says that it copied the URL to the clipboard, but it still results in No linkable item found in Hookmark. I’ve tried to debug the part of the script after “Copy URL” without success.

Edit, managed to fix this, the menu item “Edit Title” was renamed to “Rename…” with a bloody ellipsis character instead of three dots.

click menu item "Rename…" of menu 1 of menu bar item "File" of menu bar 1

Edit #2: if theURL’s document ID is extracted and parsed into museapp://documents/<documentID>, the Hook will now act as an app deeplink to that document. Here’s what works for me:

use AppleScript version "2.5" -- macOS 10.11 or later
use framework "Foundation"
use scripting additions

set the clipboard to ""
delay 0.1

tell application "System Events" to tell process "Muse"
	click menu item "Copy URL" of menu 1 of menu bar item "File" of menu bar 1
	
	delay 0.1
	repeat 10 times -- poll clipboard for ~2.5 seconds. Sometimes set x to the clipboard throws exception
		try
			set theURL to the clipboard
			if theURL is not equal to "" then
				exit repeat
			end if
			
			
		end try
		delay 0.1
	end repeat
	set theURL to the clipboard
	set AppleScript's text item delimiters to "/link/"
	try
		set docID to the second text item of theURL
	end try
	set newURL to "museapp://documents/" & docID
	set the clipboard to ""
	delay 0.1
	try
		click menu item "Show Interface" of menu 1 of menu bar item "View" of menu bar 1
		delay 0.2
	end try
	click menu item "Rename…" of menu 1 of menu bar item "File" of menu bar 1
	delay 0.2
	keystroke "c" using {command down}
	delay 0.2
	set theTitle to the clipboard
	
end tell
return "[" & theTitle & "](" & newURL & ")"
1 Like