Re: repeat problem
Re: repeat problem
- Subject: Re: repeat problem
- From: "Marc K. Myers" <email@hidden>
- Date: Tue, 25 Sep 2001 16:35:34 -0400
- Organization: [very little]
>
From: Steve Suranie <email@hidden>
>
To: "'email@hidden'"
>
<email@hidden>
>
Subject: repeat problem
>
Date: Tue, 25 Sep 2001 14:19:50 -0400
>
>
Hi folks:
>
>
Can anyone give me a hint as to why this is happening:
>
>
I am using a repeat statement to go through the contents of a folder and
>
determine the file type of the files in that folder. If they match a certain
>
type I want to do one thing, if not I want to ignore them. (For now I am
>
just moving the ones I want to do something to to another folder.
The problem is that as you move things out of the folder you no longer
have the same number of things IN the folder. Your initial item count
no longer applies. You can get around this by working down from the
last item rather then up from the first one.
However, I'd like to suggest a different approach that doesn't involve
so much mucking about in that notoriously slow app, the Finder.
Instead of working directly in the folder, use the Finder once to make
an alias list of all the files in the folder and work with the list.
Create empty lists for each destination to which you'll be sending
files. Step through the list of files, processing each one with the
"info for" scripting addition to find its creator code. Based on
creator code, copy the list item to the end of the appropriate
destination list. When you're done stepping through the file list
you'll have a list of files for each destination. Now you can bring up
the Finder again and move all the files going to a particular
destination in a single "move" statement.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[9/25/01 4:35:22 PM]