(no subject)
(no subject)
- Subject: (no subject)
- From: "Wallace, William" <email@hidden>
- Date: Thu, 20 Nov 2003 11:44:24 -0600
Okay, is there any way to make a repeat loop count backwards like the following snippet does not:
set loop_list to {"a", "b", "c", "d"}
repeat with i from (count of loop_list) to 1
display dialog item i
end repeat
-->does nothing. presumably because the repeat loop ends before it starts because the start value is greater than the stop value and "repeat with i from..." wants to increment.
I could do:
set loop_list to {"a", "b", "c", "d"}
set loop_complete to false
set my_iter to count of loop_list
repeat until loop_complete is true
if my_iter > 0 then
display dialog item my_iter of loop_list
set my_iter to my_iter - 1
else
set loop_complete to true
end if
end repeat
-->works fine. display list items in reverse order (i.e. d,c,b,a)
But I was wondering if there was a more built-in feature of repeat loops that allowed me to achieve this. I poked around in the usual spots but didn't find any.
And maybe what I'm ultimately looking for exists elsewhere in a simple straightforward manner.
What I have is two file paths and I want start at the end of the path and work backwards comparing one path to the other to see where their paths cross. You might think that I should start at the beginning and then see where they diverge, but the the two file paths I'm comparing are not necessarily from the same file system (one is the file path of an image as reported by a Quark document's usage window, the other is the actual current location of the Quark document).
This is all taking place in MacOS 9.2.2 with AS 1.8.3, so scripting unix commands in a terminal window won't help.
Anyway, advice or suggestions are always welcome.
B!ll
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.