Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
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]

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



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)

tell application "Finder"
repeat with i from 1 to count item of the selection
set s to item i of the selection as alias
try
set k to ,
(open fork from s with write access and resource fork)
size fork k to 0
close fork k with flushing
on error
close fork k with flushing
display dialog "There was a problem!" with icon 0
return
end try
display dialog "It's done!" with icon 1
end repeat
end tell

JJ

* Now starts an OS-9.1-applescript-questions-rain over you!




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.