Re: Calling subroutine in a repeat block
Re: Calling subroutine in a repeat block
- Subject: Re: Calling subroutine in a repeat block
- From: Jay Louvion <email@hidden>
- Date: Mon, 26 Dec 2005 14:51:54 +0100
Title: Re: Calling subroutine in a repeat block
On 26/12/05 14:05, "Neil Faiman" <email@hidden> wrote:
You have the textToList call inside a 'tell application "Mail", so the call is getting sent to Mail, which doesn't know what to do with it.
Well it seems as though “script” doesn’t know what to do with it either ;-)
->“script” doesn’t understand the TextToList message.
(run both from the Script Editor and menu)
I understand the idea, but how can we get this to work ?
J.
--SCRIPT
using terms from application "Mail"
on perform mail action with messages incomingMessages
try
tell application "Mail"
repeat with msg in incomingMessages
set contentString to (content of msg) as string
set theSubject to subject of msg
tell me to set eventData to testToList(contentString, tab)
end repeat
end tell
set EventDate to item 1 of eventData
set EventStartTime to item 2 of eventData
set EventEndTime to item 3 of eventData
set EventRecurrence to item 4 of eventData
set Photographer to item 5 of eventData
set JobNr to item 6 of eventData
set JobStatus to item 7 of eventData
set eventName to item 8 of eventData
set ClientFirstName to item 8 of eventData
set ClientLastName to item 9 of eventData
set ClientCellPhone to item 10 of eventData
set EventDescription to item 11 of EventDate
--TESTING
display dialog Photographer & space & ClientLastName & space & JobNr
--TESTING
on error mistake
display dialog mistake
end try
end perform mail action with messages
on run
tell application "Mail" to set sel to selection
tell me to perform mail action with messages sel
end run
on textToList(thisText, delim)
set resultList to {}
set {tid, my text item delimiters} to {my text item delimiters, delim}
try
set resultList to every text item of thisText
set my text item delimiters to tid
on error
set my text item delimiters to tid
end try
return resultList
end textToList
end using terms from
--END SCRIPT
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
skypeme:
jaylouvion
www.studiocasagrande.com
P Please consider the environment before printing this email.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden