If you do not receive any reply to your questions, it is likely due to these things:

1) "Be sensitive in choosing where you ask your question. You are likely to be ignored, or written off as a loser, if you: ... • cross- post to too many different newsgroups"

2) "When selecting a Web forum, newsgroup or mailing list, don't trust the name by itself too far; look for a FAQ or charter to verify your question is on-topic"

Both quotes from: http://catb.org/esr/faqs/smart-questions.html.

That said, the right place for this question is:

https://devforums.apple.com/community/mac

Alex



Am 13.07.2009 um 11:28 schrieb william lee:

Hi,
I have a problem with Mac 10.6 Cocoa application embed Applescript now. The following code works fine in Mac 10.5, and they are almost come from Apple Tech doc.
But they doesn't work in Mac 10.6.
My App will launch Mail.app, will create an out going message, but can't set the recipient.
And also return a error said:
"Mail got an error: Can't get outgoing message id 409110912"

It seems error happen during "tell theMessage" line, and "111" pop up as expected. "222" will not be reached. Strangely, the exactly same code will work in AppleScript Editor in both 10.5 and 10.6.

Is this a bug in Mac 10.6 or my code error? Does anyone encounter this before?

Thanks

William L.

--------------------------------Part of code-------------------------------------------
 NSString *scriptSource = @" \
                    tell application \"Mail\" to activate\n \
                    tell application \"Mail\"\n \
set theMessage to make new outgoing message with properties {visible:true, subject:\"sssss\", content:\"ccccc\"} \n \
                        display dialog \"111\"\n \
                        tell theMessage\n \
make new to recipient at end of to recipients with properties {address:\"[email protected]\"}\n \
                        end tell\n \
                        display dialog \"222\"\n \
                    end tell";
int iRes = NSRunAlertPanel(@"scriptSource", scriptSource, @"OK", nil, nil);
     NSDictionary* errors = [NSDictionary dictionary];
NSAppleScript* appleScript = [[NSAppleScript alloc] initWithSource:scriptSource];

     if (appleScript != nil)
     {

          [appleScript executeAndReturnError: &errors];
iRes = NSRunAlertPanel(@"errors", [errors valueForKey:@"NSAppleScriptErrorMessage"], @"OK", nil, nil);


          [appleScript release];

          return true;
    }
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-implementors/below%40mac.com

This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to