Re: AppleScript Runner Problems?
Re: AppleScript Runner Problems?
- Subject: Re: AppleScript Runner Problems?
- From: KOENIG Yvan <email@hidden>
- Date: Mon, 02 May 2011 21:48:05 +0200
Le 2 mai 2011 à 19:15, S. J. Cunningham a écrit : Thanks! Your change seems to have fixed the problem with my script. I should have been more careful with the property :-) As far as the system script, that appears to be a different problem: I found that if you select the signature "none", the script terminates... that's why no editable message appears. If you select an actual signature, the script continues as expected. On May 2, 2011, at 12:53 PM, KOENIG Yvan wrote: [snip] 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.
I looked at the script delivered by Apple.
If you select the item "None", the instruction:
tell application "Mail" to set theSignature to signature (item 1 of theResult)
logically fails because there os no signature whose name is "none".
I would edit this way the original piece of code :
if (count of everySignature) is greater than 0 then set everySignature to {"None"} & everySignature set theResult to choose from list everySignature with prompt ¬ "Select a signature to use with this message:" default items {"None"} without multiple selections allowed if theResult is not equal to false then set selected_item to item 1 of theResult if selected_item is not "None" then tell application "Mail" to set theSignature to signature selected_item end if end if end if
I would edit this way the original piece of code : With this modified code, selecting the item "None" will behave exactly as clicking the button Cancel. I guess that, the item "None" was designed to display something even when there is no defined signature. In this case, the dialog will display "None" aqua "no signature available".
Yvan KOENIG (VALLAURIS, France) lundi 2 mai 2011 21:48:00
|
_______________________________________________
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