aboutsummaryrefslogtreecommitdiffstats
path: root/CopyMailto/AppDelegate.m
diff options
context:
space:
mode:
authorTeddy Wing2018-09-05 20:51:28 +0200
committerTeddy Wing2018-09-05 20:51:28 +0200
commitd24637ebbadfd31826609fd638c5851d3ce29f98 (patch)
treeb8e4037d0a5026ae00d2b2227976819a4aba5840 /CopyMailto/AppDelegate.m
parent9d8676896db252f4b6c7364da66947504ee33d3b (diff)
downloadCopy-Mailto-d24637ebbadfd31826609fd638c5851d3ce29f98.tar.bz2
Add label that displays the email address coming from `mailto`
It starts with `mailto:`, so we remove that with a substring method call.
Diffstat (limited to 'CopyMailto/AppDelegate.m')
-rw-r--r--CopyMailto/AppDelegate.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/CopyMailto/AppDelegate.m b/CopyMailto/AppDelegate.m
index 213f403..6f3477d 100644
--- a/CopyMailto/AppDelegate.m
+++ b/CopyMailto/AppDelegate.m
@@ -8,6 +8,8 @@
#import "AppDelegate.h"
+const NSUInteger MAILTO_INDEX = 7;
+
@implementation AppDelegate
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
@@ -28,7 +30,7 @@
{
NSString *url = [[event paramDescriptorForKeyword:keyDirectObject]
stringValue];
- NSLog(@"%@", url);
+ [_email_address setStringValue:[url substringFromIndex:MAILTO_INDEX]];
}
@end