Revision: 6937
http://skim-app.svn.sourceforge.net/skim-app/?rev=6937&view=rev
Author: hofman
Date: 2010-12-06 12:28:08 +0000 (Mon, 06 Dec 2010)
Log Message:
-----------
use bundle id for default mail app
Modified Paths:
--------------
trunk/SKMainDocument.m
Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m 2010-12-06 00:37:19 UTC (rev 6936)
+++ trunk/SKMainDocument.m 2010-12-06 12:28:08 UTC (rev 6937)
@@ -1074,12 +1074,9 @@
- (BOOL)emailAttachmentFile:(NSString *)fileName {
NSString *scriptFormat = nil;
- NSString *mailAppName = nil;
- CFURLRef mailAppURL = NULL;
+ NSString *mailAppID = [(NSString
*)LSCopyDefaultHandlerForURLScheme(CFSTR("mailto")) autorelease];
- if (noErr == LSGetApplicationForURL((CFURLRef)[NSURL
URLWithString:@"mailto:"], kLSRolesAll, NULL, &mailAppURL))
- mailAppName = [[[(NSURL *)mailAppURL path] lastPathComponent]
stringByDeletingPathExtension];
- if ([mailAppName rangeOfString:@"Entourage"
options:NSCaseInsensitiveSearch].length) {
+ if ([@"com.microsoft.entourage" caseInsensitiveCompare:mailAppID] ==
NSOrderedSame) {
scriptFormat = @"tell application \"Microsoft Entourage\"\n"
@"activate\n"
@"set m to make new draft window with properties
{subject:\"%...@\", visible:true}\n"
@@ -1087,7 +1084,7 @@
@"make new attachment with properties {file:POSIX file
\"%...@\"}\n"
@"end tell\n"
@"end tell\n";
- } else if ([mailAppName rangeOfString:@"Mailsmith"
options:NSCaseInsensitiveSearch].length) {
+ } else if ([@"com.barebones.mailsmith" caseInsensitiveCompare:mailAppID]
== NSOrderedSame) {
scriptFormat = @"tell application \"Mailsmith\"\n"
@"activate\n"
@"set m to make new message window with properties
{subject:\"%...@\", visible:true}\n"
@@ -1095,7 +1092,7 @@
@"make new enclosure with properties {file:POSIX file
\"%...@\"}\n"
@"end tell\n"
@"end tell\n";
- } else if ([mailAppName rangeOfString:@"Mailplane"
options:NSCaseInsensitiveSearch].length) {
+ } else if ([@"com.mailplaneapp.Mailplane"
caseInsensitiveCompare:mailAppID] == NSOrderedSame) {
scriptFormat = @"tell application \"Mailplane\"\n"
@"activate\n"
@"set m to make new outgoing message with properties
{subject:\"%...@\", visible:true}\n"
@@ -1103,12 +1100,12 @@
@"make new mail attachment with properties
{path:\"%...@\"}\n"
@"end tell\n"
@"end tell\n";
- } else if ([mailAppName rangeOfString:@"PostboxExpress"
options:NSCaseInsensitiveSearch].length) {
+ } else if ([@"com.postbox-inc.postboxexpress"
caseInsensitiveCompare:mailAppID] == NSOrderedSame) {
scriptFormat = @"tell application \"PostboxExpress\"\n"
@"activate\n"
@"send message subject \"%...@\" attachment \"%...@\"\n"
@"end tell\n";
- } else if ([mailAppName rangeOfString:@"Postbox"
options:NSCaseInsensitiveSearch].length) {
+ } else if ([@"com.postbox-inc.postbox" caseInsensitiveCompare:mailAppID]
== NSOrderedSame) {
scriptFormat = @"tell application \"Postbox\"\n"
@"activate\n"
@"send message subject \"%...@\" attachment \"%...@\"\n"
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit