diff options
author | Teddy Wing | 2018-09-05 20:51:28 +0200 |
---|---|---|
committer | Teddy Wing | 2018-09-05 20:51:28 +0200 |
commit | d24637ebbadfd31826609fd638c5851d3ce29f98 (patch) | |
tree | b8e4037d0a5026ae00d2b2227976819a4aba5840 /CopyMailto/AppDelegate.m | |
parent | 9d8676896db252f4b6c7364da66947504ee33d3b (diff) | |
download | Copy-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.m | 4 |
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 |