• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Calling subroutine in a repeat block
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Calling subroutine in a repeat block
      • From: Yvan KOENIG <email@hidden>
    • Re: Calling subroutine in a repeat block
      • From: Neil Faiman <email@hidden>
  • Prev by Date: Re: Getting the name of selected cell (FileMaker)
  • Next by Date: File type and encoding rates.
  • Previous by thread: Re: Getting the name of selected cell (FileMaker)
  • Next by thread: Re: Calling subroutine in a repeat block
  • Index(es):
    • Date
    • Thread