Airmail 4.1.5 (631): Link not opening

Hello everyone,

heard about Hook on MPU 549 and and here I am testing Hook.

I am using Airmail 4.1.5 as main Mail client. The Airmail links are created and can be attached to another object, but they can’t be opened. Then changed the default Mail app Apple Mail, but when opening Hook to copy the link still the Airmail Icon is shown. This link isn’t working either.

Is Airmail 4 even supported?

Thanks for any help.

Best regards,
Thomas

Hi Thomas,

I tried this. Selected an email in Airmail 4.1.5 and copied the link with Hook. Selected a file in Finder and Hooked the file to the copied link. Then I selected a different message in Airmail and then quit Airmail. When I selected the file in Finder that I had Hooked to Airmail, and in Hook I selected the email, I saw Airmail launch and then open the email I started with in my first step.

I don’t know if you have a different circumstance, but at least in this small case the Hooking worked.

Sorry that I couldn’t find the same outcome as you.

I hope you figure this out.

My best,
Katie

1 Like

Hi Katie,

thank you for trying out.
I figured out, that when changing in the Hook > Preferences > Favorite Apps from Airmail to Mail, then it works for Mail.
In this case I can either copy the link in Mail or also in Airmail, then the applied link will open in Mail. However if Airmail - should it perhaps be Airmail 3 (as the app name is Airmail 3.app in applications - even when version is 4.1.5) - is selected, no mail app is opened.

Perhaps there is an issue with my Airmail installation… Hmm

Best,
Thomas

It was also called Airmail 3 on my Finder even though the App version is Airmail4. I tested and have not been able to replicate your issue either. The fact that you can use Hook’s Copy Link in Airmail suggests Hook is able to control it, so it’s not a permissions issue.

I don’t suppose you have modified Hook > Preferences (window) > Scripts (tab) > Airmail (entry, in left column)) > Open Item (tab) ? There would be a * next to Airmail (entry, in left column).

I wouldn’t be aware of any modification:
Capto_Capture 2020-08-23_09-19-25_AM

Hook is on the latest version:
Hook version 1.8 (3439) (Scripts version 129)

As an example, this link was taken with Airmail:
hook://email/20200814200552.1.0298AF2435C8BB86%40webinarjam.net

When copied to Apple Notes, it can’t be opened when Airmail is the Default Mail client in Hook (Airmail is not started).

However, if I change to Mail in tab ‘Favorite Apps’, the Mail is perfectly opened in Apple Mail.

Would it make sense to delete Airmail and install newly?

Best regards,
Thomas

I wonder whether for some reason you might not have a .airmail folder in [Group Containers](hook://file/nyeXiVwW7?p=bHVjYi9MaWJyYXJ5&n=Group%20Containers) (you can copy and paste that Containers hook:// URL into Spotlight or LaunchBar to get there fast).

Could you please copy paste the following in the Apple Terminal (command line) and send the result to us. (You can send it to me as a private forum message or email support@cogsciapps.com if you prefer not to make it public.) :

ls -alt ~/Library/Group\ Containers|grep airmail

Also, could you please select a different email in AirMail, then try pasting this into a new /Applications/Utilities/Script Editor document, pressing the run button (at top), and let us know the result? It normally should select the message whose URL you gave us; but it seems that it won’t in your case. Running the command may yield a helpful message at the bottom of Script Editor window.

set MessageID to "email://20200814200552.1.0298AF2435C8BB86%40webinarjam.net"
set MessageID to text 9 thru -1 of MessageID
set filePaths to do shell script "find ~/Library/Group\\ Containers/*.airmail/SharedData*/Accounts.plist"
tell application "System Events"
	set mailAccounts to {}
	repeat with filePath in every paragraph of filePaths
		try
			set itemNodes to property list items of property list file filePath
			repeat with i from 1 to number of items in itemNodes
				set itemNode to item i of itemNodes
				set mailAccount to value of property list item "mail" of itemNode
				if mailAccounts does not contain mailAccount then
					set end of mailAccounts to mailAccount
				end if
			end repeat
		end try
	end repeat
	repeat with a from 1 to length of mailAccounts
		set acc to item a of mailAccounts
		open location "airmail://message?mail=" & acc & "&messageid=" & MessageID
	end repeat
end tell

thank you

Thank you for the detailed feedback.
Just sent my feedback to the email support address.

A group container exists with the name ‘2E337YPCZY.airmail’. The terminal finds the same folder. Script editor opens airmail, but not the specific email. When the link is clicked in Apple note, nothing happens but the iCloud spinners turns for 1-2 sec.

Hi Thomas,

could you please check if there is an Accounts.plist files by running the
following command in Terminal:

find ~/Library/Group\ Containers/*.airmail/SharedData*/Accounts.plist

And check if there is any email accounts set in those files.

Then please run the following script in Apple’s Script Editor app, and see if it returns any email
accounts and account file content. For privacy, we just want to know if there is any email accounts, not the details.

set filePaths to do shell script "find ~/Library/Group\\ Containers/*.airmail/SharedData*/Accounts.plist"
tell application "System Events"
        set pfileContent to ""
        set mailAccounts to {}
        repeat with filePath in every paragraph of filePaths

                try
                        set itemNodes to property list items of property list file filePath
                        repeat with i from 1 to number of items in itemNodes
                                set pfileContent to pfileContent & (read filePath)
                                set itemNode to item i of itemNodes
                                set mailAccount to value of property list item "mail" of itemNode
                                if mailAccounts does not contain mailAccount then
                                        set end of mailAccounts to mailAccount
                                end if
                        end repeat
                end try
        end repeat

        repeat with a from 1 to length of mailAccounts
                set acc to item a of mailAccounts
                set filePaths to filePaths & "      " & acc
        end repeat
        set res to filePaths & "     " & pfileContent
end tell

Thank you again for your persistence.

Luc
iPhone: 778 997-0612
CogSci Apps Corp.

The script error is because there should be \\ (two backslashes) , not just \ (one), after Group in the first line of the script. From your screenshots, it looks like you copied the line that was meant for the Terminal (which has one backslash) into the code that is meant for Script Editor. The script block we provided Airmail 4.1.5 (631): Link not opening for Script Editor, had two…

If you copy it precisely the way it is, it should work. I’ll copy/paste it again here:

set filePaths to do shell script "find ~/Library/Group\\ Containers/*.airmail/SharedData*/Accounts.plist"
tell application "System Events"
        set pfileContent to ""
        set mailAccounts to {}
        repeat with filePath in every paragraph of filePaths

                try
                        set itemNodes to property list items of property list file filePath
                        repeat with i from 1 to number of items in itemNodes
                                set pfileContent to pfileContent & (read filePath)
                                set itemNode to item i of itemNodes
                                set mailAccount to value of property list item "mail" of itemNode
                                if mailAccounts does not contain mailAccount then
                                        set end of mailAccounts to mailAccount
                                end if
                        end repeat
                end try
        end repeat
        repeat with a from 1 to length of mailAccounts
                set acc to item a of mailAccounts
                set filePaths to filePaths & "      " & acc
        end repeat
        set res to filePaths & "     " & pfileContent
end tell

thank you.