Re: AppleScript Runner Problems?
Re: AppleScript Runner Problems?
- Subject: Re: AppleScript Runner Problems?
- From: KOENIG Yvan <email@hidden>
- Date: Mon, 02 May 2011 18:53:01 +0200
Le 2 mai 2011 à 18:39, S. J. Cunningham a écrit :
>
> I have written a fairly trivial script to compose a new, pre-addressed Mail message and then open it for editing (see attached). The script is based on the "Create New Message" script that ships with the system and is found in the Mail Folder of the Scripts menu. Both my script and the system script frequently - but not always - fail to bring up the new message for editing after running. And there is no new message in the "Drafts" folder. The script appears to exit normally without leaving a trace. Both scripts execute as expected when run from ScriptDebugger.
>
> The only indication of a potential problem I can find is a message in the console log, to wit:
>
> 5/2/11 12:16:33 PM /System/Library/CoreServices/AppleScript Runner.app/Contents/MacOS/AppleScript Runner[14530] CPSGetFrontProcess(): This call is deprecated and should not be called anymore.
>
> Maybe it has moved from "deprecated" to "not supported" ?
>
> I'm using Mac OS X 10.6.7 on a MacBook Pro.
>
> BTW, I did notice that several of the draft messages from yesterday showed up in the draft mailbox after I quit and relaunched Mail this morning, but I can't reproduce that either. I rebuilt the Envelope Index file as a precaution but that didn't solve the problem.
>
> Can anyone else verify that this is a problem or suggest a way to troubleshoot it?
>
> Thanks.
>
> Att: My Script:
>
> property freecycleEmail : {name:"Orange County Freecycle", address:"email@hidden"}
> property theSender : "email@hidden"
> property theSignature : "Freecycle Offer"
> property theBody : ""
>
> set theSubject to "OFFER: " & text returned of (display dialog "Freecycle Offer?" default answer "")
>
> tell application "Mail"
> activate
> set theSignature to signature theSignature -- Don't understand why I have to do this in two steps
This instruction coerce an object of class string into an object of class signature (a Mail class)
This is why you must do what you described as "do this in two steps"
For my own use, I would not use the same name for objects of different classes.
Leaving theSignature as a string, I would use the_Signature for the object of class signature
With your posted code,
at first run the entry property is a string.
you coerce it to a signature so, at second run, the entry property is of class signature
and I don't know the behavior of
set theSignature to signature theSignature
when theSignature is already a signature.
So, I would code :
tell application "Mail"
activate
set the_Signature to signature theSignature -- Don't understand why I have to do this in two steps
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody}
tell newMessage
set sender to theSender
make new to recipient at end of to recipients with properties freecycleEmail
set message signature to the_Signature
set visible of newMessage to true
activate
end tell
end tell
And maybe, the described problem will disappear.
Yvan KOENIG (VALLAURIS, France) lundi 2 mai 2011 18:52:55
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden