• 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
RE: Short form
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Short form


  • Subject: RE: Short form
  • From: "Script2" <email@hidden>
  • Date: Fri, 5 Sep 2008 15:19:45 -0400
  • Importance: Normal

Hi Michelle

I tried this but does not work. What am I doing wrong, it just displays CN
not found or TO not found.

tell application "Finder"
    set file1text to read file ("Macintosh HD:Ruby:Paragraph Count:Issue
List:M808") from 1
    set gterm to every paragraph of file1text
    repeat with aWord in gterm
        set sname to characters 19 thru 20 of aWord
        if sname is in {"CN", "TO", "LS"} then
            display dialog (sname as string) & " found"
        else
            display dialog (sname as string) & " not found"
        end if
    end repeat
end tell



Thanks for your help

Ruby
-----Original Message-----
From: applescript-users-bounces+script2=email@hidden
[mailto:applescript-users-bounces+script2=email@hidden]
On Behalf Of Michelle Steiner
Sent: Friday, September 05, 2008 1:43 PM
To: Applescript Users
Subject: Re: Short form

On Sep 5, 2008, at 10:35 AM, Script2 wrote:

> Is there a short form for writing this "if" statement
>
> If sname = "CN" or sname = "DD" or sname = "DR" or sname = "FM" then
> (I have
> about 10 names to check)


if sname is in {"CN", "DD", "DR"} then
	-- do something
else
	-- do something else
end if

--
Please contribute to the Leukemia and Lymphoma Society, and help me
meet my fund raising goal for my marathon training.
<http://www.active.com/donate/tntdms/tntdmsMSteine>




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
tern.com
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Short form
      • From: Michelle Steiner <email@hidden>
    • Re: Short form
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Re: Short form (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Short form
  • Next by Date: Re: Short form
  • Previous by thread: Re: Short form
  • Next by thread: Re: Short form
  • Index(es):
    • Date
    • Thread