RE: applescript-users digest, Vol 3 #346 - 12 msgs
RE: applescript-users digest, Vol 3 #346 - 12 msgs
- Subject: RE: applescript-users digest, Vol 3 #346 - 12 msgs
- From: "Steve Suranie" <email@hidden>
- Date: Fri, 12 Apr 2002 12:40:36 -0400
- Thread-topic: applescript-users digest, Vol 3 #346 - 12 msgs
Hi folks:
I'm writing a script of which a portion validates file names of a file. The file name structure is as follows:
NP041102_IL_DESCRIPTION.tif
If this helps the name above breaks down like this -
First 2 characters - a 2 letter designator for one of our magazines, followed by the date, followed by another two letter designator for file type (Photograph, Photo Illustration, Illustration. etc. etc., followed by something to vaguely describe the contents of the file and then a standard extension. (.gif, .tif, etc.)
I have a list (array) of all the magazine names and compare the first two characters of the file name against this list to validate that a correct magazine has been entered and that works fine.
I'm getting stumped at how to validate the date.
I thought I could try to coerce the string to an integer and then try to trap for an error such as this:
try
set dateCheck to text from character 3 to 8 of word 1 of fileName
set dateCheck to dateCheck as integer
--do other scripting stuff here
on error
return
end try
I am going to say this failed for in my test folder I have seven correct files but it only recognizes 3 of them. Any idea of how I can validate this without writing a bunch of arrays?
Thanks
Steve
_______________________________________________
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.