• 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
test a range of numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

test a range of numbers


  • Subject: test a range of numbers
  • From: danday <email@hidden>
  • Date: Wed, 23 Oct 2002 15:25:21 -0500

Is it possible to have an "if" statement test for a range of numbers?

for example

if theFile begins with [1-3] then ...

which would be true for any file that begins with the numbers 1, 2, or 3. I'm working on a script that will move files into folders based on their names. The file names consist of 8 numbers such as 10236829. The folders are broken up so files are sorted depending on the first two digits like this:

00-05
06-09
10-29
30-49
50-99

I can get to work if I have a bunch of if/else like

if theFile begins with 00 then....
else if theFile begins with 01 then...

but I would like to avoid so many if/else statements. Any suggestions?

Thanks,
Dan
_______________________________________________
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.

  • Prev by Date: Scriptable compression software...
  • Next by Date: Re: Eudora Settings was Re: User N...
  • Previous by thread: Re: Scriptable compression software...
  • Next by thread: Re: test a range of numbers
  • Index(es):
    • Date
    • Thread