Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: repeat with i from 1 to count items of the selection (9.1)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: repeat with i from 1 to count items of the selection (9.1)



JJ (email@hidden) schreef op 29-06-2001 09:34 :

> What's up with this routine?
> It can work fine or not. If the selection = 1 item,
> the script can execute two times and then crashes the system.
> I use this script to delete data fork from files, many times per day, and
> "repeat with i from 1
> ", all the day!
> I re-compiled it, but the result is the same.
> Any known problem? (OS 9.1, applescript 1.5.5)


I don't know if this has anything to do with it, but I found that if I want
to do something with selected files it is usually more reliable to set some
variable to "the selection" and continue with i to count of items of that
variable, instead of directly working with the selection. The selection
might change while the script is running, the count items changes with it,
and things go wrong with the loop. If you have the initial selection fixed
in some list variable that can't happen.

JP


References: 
 >repeat with i from 1 to count items of the selection (9.1) (From: JJ <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.