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

RE: another short form


  • Subject: RE: another short form
  • From: "Script2" <email@hidden>
  • Date: Tue, 9 Sep 2008 12:22:57 -0400
  • Importance: Normal

Thanks Michelle. This worked too.

 

-----Original Message-----
From: applescript-users-bounces+script2=email@hidden [mailto:applescript-users-bounces+script2=email@hidden] On Behalf Of Michelle Steiner
Sent: Tuesday, September 09, 2008 9:54 AM
To: Applescript Users
Subject: Re: another short form

 

On Sep 9, 2008, at 6:33 AM, Script2 wrote:



I have string of about 70 characters, I want to check if characters 6,9,12,16,19,24 so on is = “-

 

I assume that "19" is a typo and you meant to type "18".



If character 6 of aname = “-“ (this gets too lengthy.)

 

If character 9 of aname = “-“

 

Try this for starters:

 

set a to "ab-cd-efghi-ab-cd-efghi-ab-cd-efghi-ab-cd-efghi-ab-cd-efghi-ab-cd-efghi-90"

repeat with i from 3 to count of a by 3

                                if character i of a is "-" then

                                                                display dialog "character " & i & " is -"

                                else

                                                                display dialog "character " & i & " is not -"

                                end if

end repeat

 

You will need to add some error checking to test for an overrun at the end of the string.

 

-- Michelle

 

--

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:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • RE: another short form
      • From: "Script2" <email@hidden>
References: 
 >Re: another short form (From: Michelle Steiner <email@hidden>)

  • Prev by Date: set optionKeyDown to...
  • Next by Date: Network Mount
  • Previous by thread: Re: another short form
  • Next by thread: RE: another short form
  • Index(es):
    • Date
    • Thread