blob: 2cf4fcefcaaae6dc8b1b9099239697f66dc48270 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
//
// AppDelegate.m
// CopyMailto
//
// Created by tw on 9/5/18.
// Copyright © 2018 tw. All rights reserved.
//
#import "AppDelegate.h"
@implementation AppDelegate
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
[[NSAppleEventManager sharedAppleEventManager]
setEventHandler:self
andSelector:@selector(handleURLEvent:withReplyEvent:)
forEventClass:kInternetLocationMail
andEventID:kAEOpenApplication];
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application
}
- (void)handleURLEvent:(NSAppleEventDescriptor *)event
withReplyEvent: (NSAppleEventDescriptor *)replyEvent
{
NSString *url = [[event paramDescriptorForKeyword:keyDirectObject]
stringValue];
NSLog(@"%@", url);
}
@end
|