From 9d8676896db252f4b6c7364da66947504ee33d3b Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 5 Sep 2018 20:48:53 +0200 Subject: applicationWillFinishLaunching:: Fix `NSAppleEventManager` registration Set correct event class and ID. I just picked a couple that seemed reasomable but it didn't work to open the app based on the URL handler because of the values I picked. Use the exact example as a reference from before: [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; from Thomas Zoechling (https://stackoverflow.com/users/100848/thomas-zoechling) on Stack Overflow: https://stackoverflow.com/questions/1991072/how-to-handle-with-a-default-url-scheme/1991162#1991162 --- CopyMailto/AppDelegate.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CopyMailto') diff --git a/CopyMailto/AppDelegate.m b/CopyMailto/AppDelegate.m index 2cf4fce..213f403 100644 --- a/CopyMailto/AppDelegate.m +++ b/CopyMailto/AppDelegate.m @@ -14,8 +14,8 @@ [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleURLEvent:withReplyEvent:) - forEventClass:kInternetLocationMail - andEventID:kAEOpenApplication]; + forEventClass:kInternetEventClass + andEventID:kAEGetURL]; } -- cgit v1.2.3