Hook <> Spark Email Integration

Hi All

Just thought I’d contribute to this wonderful forum

If anyone is interested, you can add “Spark” to hook preferences > scripts, and then…

on Get Name tab

On Get Address tab

If you were to invoke hook to copy a message in Spark, you’d get this

image

Found the basis for this Applescript in one of the Macsparky forums and repurposed it. Can’t recall it where exactly… but thanks to whoever it was

Regards
Ken

I’ve entered the scripts as you recommended, but I get “No Linkable item found” when invoking Hook with a message selected in the Spark Inbox. Hook 2.0.3

btw, I tried executing the AppleScript in the script editor, but neither returned anything useful. I’m on Big Sur, Spark v2.9.10.755. On which versions did this work for you?

Hi Chris. I’m using Spark 2.9.9.750 and I’m on Catalina 10.15.7 and also on Hook 2.0.3. I don’t know why it’s not working for you. Maybe someone else who tried and got it to work can comment

Ok I’m not sure why this is working for me, but this is what I’m currently using and it appears to work. I’m on Big Sur with Spark v2.9.11 and Hook 2.0.3.

Get Name

tell application "Spark"
	if HasSelectedMessage then
		set theResult to GetSelectedMessageTitle
		return theResult
	end if
end tell

Get Address

tell application "Spark"
	if HasSelectedMessage then
		set theResult to GetSelectedMessageBacklink
		return theResult
	end if
end tell
2 Likes

This works beautifully! Thanks.

Must a Big Sur thing.

super! Last time we checked Spark didn’t have AppleScript support. Great they’ve added it.

The URLs would only work with other Spark clients (i.e., if you send it to someone who does that Spark, it wouldn’t work). If GetSelectedMessageBacklink is RFC5322 (email) compatible, we could construct a hook://email client URL that is compatible with other mail clients. However, the advantage of this link format is that it can already be used on iOS.

I haven’t it tried it yet. If someone could send us a few sample spark URLs we would have a look before digging into Spark itself and its documentation.

This is absolutely brilliant!
Thank you, getting Spark to work with Hook has been on my wish list for a while.

This is amazing! I found out about Hook when I posted a question on the Roam Research forums about how to get emails into Roam. Someone recommended Hook, I came here and found that there is an integration with Spark but it lacks automation. Then I saw this thread!

I added the script code to Hook. I invoked Hook on an email, copied the link, then tried pasting the link in the URL window of Safari. That prompted me to open Spark and I did see the email. I also tried pasting the link in TextEdit. That worked fine too.

But, when I paste the link into Roam Research, it doesn’t work. If I just paste the link directly into a Roam note, I see this syntax: Day V: Inline Calculator, where “Day V: Inline Calculator” is the subject line of the email. If I use “Command-k” to turn some text in Roam into this link, Roam does create a hyperlink. But when I click on the hyperlink, I get this error message:

“404: NOT_FOUND
Code: NOT_FOUND
ID: sfo1::rfzp5-1606743779321-5a5ff6ae1ee5”

Anyone know why this is happening?

I’ve been discussing this on the Roam forum as well. One of the mods there downloaded Hook app, installed the Spark script, and tried copying and pasting a link. It worked just fine for him. He asked if this might be a Big Sur issue? (He’s not running Big Sur.)

Here is the Roam forum thread.

If you read further back in this thread, you can see there are two versions of the scripts. One seems to work with pre-big sur, and the second with big sur. At least, that’s worked for me.

This isn’t working for me, I wonder if Spark stopped supporting it? Or did I enter something wrong?

Hi @josh. That looks different from the script we recently added in Hook integration scripts v.146 now available — Spark by Readdle and Mailplane - Releases - Hook Productivity Forum

Yes, you’re correct sorry! I must’ve accidentally unchecked auto-updates, because I was running an older version on both my macs. After updating, everything works as expected. Thank you!

1 Like