Re: set var to foo; get var of record?
Re: set var to foo; get var of record?
- Subject: Re: set var to foo; get var of record?
- From: Terje Bless <email@hidden>
- Date: Fri, 18 Oct 2002 00:03:13 +0200
John Delacour <email@hidden> wrote:
>
It is technically possible to do this departing from an AppleScript
>
record, but it's slow and ugly and not meant to be. This is one of
>
several thousand fundamental shortcomings in AppleScript.
Pity. This would have made any number of my little projects ever so much
easier. Is there any particular reason why this is not available in
AppleScript? Is it just that nobody has gotten around to implement it yet,
or is there simply no way to reconcile this with some fundamental
philosophy of AppleScript (of which I'm too much the novice to be aware
of)?
>
Here is how you might set a Eudora personality according to the address
>
in the From field: [...]
Thanks John, that was exactly what I was trying to do (albeit for Mailsmith
and not Eudora). I ended up using your script pretty much as it was with
only a sprinkling of Mailsmith-isms thrown in.
In case anyone would find it usefull, the end result -- a Mailsmith 1.5
(attachable) Menu Script -- is:
-- cut here
(*
Slightly modified version of script by John Delacour
<email@hidden>.
*)
property originator_ : ""
property accounts_ : {"email@hidden", "Account 1", ,
"email@hidden", "Account 2"}
on menuselect(menuName, itemName)
set originator_ to "" -- Reset on each invocation.
tell application "Mailsmith 1.5"
set originator_ to address string of originator ,
of message of message window 1
end tell
return false
end menuselect
on postmenuselect(menuName, itemName)
repeat with i from 1 to count accounts_
if i mod 2 is 1 then
if item i of accounts_ is in originator_ then
set account_ to item (i + 1) of accounts_
exit repeat
end if
end if
end repeat
tell application "Mailsmith 1.5"
set sending account of message window 1 to account_
end tell
end postmenuselect
-- cut here
If anyone feels like making extended commentary -- or even just snide
remarks :-) -- on my AppleScript "babytalk", feel free to do so (though
perhaps off-list to spare the regulars). I'm sufficiently lost when it
comes to AppleScript that any and all feedback is gold to me! :-)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.