Calling subroutine in a repeat block
Calling subroutine in a repeat block
- Subject: Calling subroutine in a repeat block
- From: Jay Louvion <email@hidden>
- Date: Mon, 26 Dec 2005 13:01:21 +0100
Title: Calling subroutine in a repeat block
Hi all,
I’ve got this piece of script that returns the most helpful “Mail returned an error: can’t continue TextToList”, anyone know how I can get this to work ? And most of all, why I can’t do this ? It’s obviously got to be called within the repeat block, but only work on the outside for the moment...
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
set eventData to textToList(contentString, tab)
end repeat
end tell
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
end using terms from
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
TIA,
J.
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