• 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: Does AppleScript have arrays within the language?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: problem using Applescript with Excel
  • Next by Date: "List View" ASIP Please!
  • Previous by thread: Re: Does AppleScript have arrays within the language?
  • Next by thread: Re: Does AppleScript have arrays within the language?
  • Index(es):
    • Date
    • Thread