Re: Does AppleScript have arrays within the language?
Re: Does AppleScript have arrays within the language?
- Subject: Re: Does AppleScript have arrays within the language?
- From: Guy Algot <email@hidden>
- Date: Wed, 13 Dec 2000 10:59:34 -0700
On 12/13/00 10:29 AM, Nick Middleweek sent:
>
In order to loop through the files in a folder do we have to put them into a
>
list and loop through the list or can we just loop through the files of the
>
folder object?
I think the easiest and fastest way would be to loop thru the list, if
you intend to perform an action on each one. For example;
repeat with x from 1 to number of items in y -- where y is a list of
folders
select item x of y
set view of container window of item x of y to name
close selection
end repeat
On 12/13/00 10:28 AM, Paul sent:
>
Thanks a lot!
>
But how then can I do a test on "y" to see if any of the file labels are not
>
set to 0?
>
Thanks in advance
You can loop thru the list and test each name (as shown above). You can
also expand the initial command to only include files which meet certain
criteria. For example;
set y to every file of (choose folder) whose name contains "script"
set y to every file of (choose folder) whose name is "My first script"
BTW, I have condensed the earlier line of 'folder "A Folder" of disk "My
Hard Disk"' to 'choose folder'.
Later,
Guy
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Guy Algot, Graphic Dimensions Consulting (403) 861-9882
email@hidden Calgary, Alberta
"The higher, the fewer!" Mac consulting/4D development
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
'Remember that as a teenager you are in the last stage of your
life when you will be happy to hear that the phone is for you'
-- Fran Lebowitz