• 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
Mail script broken by Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mail script broken by Tiger


  • Subject: Mail script broken by Tiger
  • From: John McKee <email@hidden>
  • Date: Mon, 8 Aug 2005 09:37:51 -0700

This is what I get for not actually learning to script while I was creating one.

My Tiger upgrade appears to have broken a script that was working well. A rule invoked the script which then harvested data from a structured email sent by a web form. It then transferred the data to a FileMaker database. It looks like the script is just ignoring everything in the message. 

I harvested the data by changing the text delimiters to bracket the data with the structured text from the web form. First, I set the delimiters to be the flag text preceding the target text, harvested the second text item, then used the extra returns as a delimiters and harvested the first text item. This worked great under 10.3.x, but broke under Tiger. Does anybody have an idea what changed and how I can fix it?

A sample of the first part of the script follows. Thanks!
John

--------------------------------------------
(*
NewShowRule

Invoked when Mail receives a message from a web form

*)

(*
This script creates a new record in the FileMaker Show Database.
*)

using terms from application "Mail"
    on perform mail action with messages theMessages
        tell application "Mail"
            repeat with eachMessage in theMessages
                set myString to content of eachMessage
                set oldDelimiters to AppleScript's text item delimiters

                

                -- Get Event Name
                try
                    set AppleScript's text item delimiters to "Event Name: "
                    set eventName to text item 2 of myString
                    set AppleScript's text item delimiters to "

" -- delimiters are now a double return as copied from the web form
                    set eventName to text item 1 of eventName
                on error
                    set eventName to ""
                end try
                -- Get Event Address
                try
                    set AppleScript's text item delimiters to "Location: "
                    set showLocation to text item 2 of myString
                    set AppleScript's text item delimiters to "

"
                    set showLocation to text item 1 of showLocation
                    set AppleScript's text item delimiters to "
" -- now a single return to break down free form text to individual lines
                    set showAddress to ""
                    repeat with lineCount from 1 to number of text items in showLocation
                        set showAddress to showAddress & text item lineCount in showLocation & return
                    end repeat
                    set showLocation to showAddress
                on error
                    set showLocation to "Call for Location"
                end try
                -- Get Event End Date

etc.

 _______________________________________________
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: Mail script broken by Tiger
      • From: "Gary (Lists)" <email@hidden>
  • Prev by Date: Re: Quitting from an idle handler
  • Next by Date: name of the front windows application
  • Previous by thread: Re: Quitting from an idle handle
  • Next by thread: Re: Mail script broken by Tiger
  • Index(es):
    • Date
    • Thread