• 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: checking for characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: checking for characters


  • Subject: Re: checking for characters
  • From: Michelle Steiner <email@hidden>
  • Date: Tue, 9 Sep 2003 21:53:33 -0700

On Tuesday, September 9, 2003, at 03:59 PM, Tait Sanders wrote:

What I'm wanting to
check for is that there are characters and then a '.' followed by more
characters. I don't care how many characters before or after but there
has to be at least 1 one either side.

set text item delimiters to {"."}

set test_list to text items of test_string

set _count to count (test_list)

if _count is 1 then
display dialog "There is no period in the string."
--handle the case as needed
else if _count > 2 then
display dialog "There is more than one period in the string."
--handle the case as needed
else if the first item of test_list is "" or last item of test_list is "" then
display dialog "There are no characters either before or after the period."
else
--handle the case as you need
end if

--
"Condoms encourage promiscuity
- in the same way that seat belts encourage automobile accidents."
O.C. Brown
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >checking for characters (From: Tait Sanders <email@hidden>)

  • Prev by Date: delay procedure for waiting less than a second
  • Next by Date: Re: Dates gone wild
  • Previous by thread: checking for characters
  • Next by thread: Re: checking for characters
  • Index(es):
    • Date
    • Thread