Path-Strings to Formatted String
Path-Strings to Formatted String
- Subject: Path-Strings to Formatted String
- From: Arthur J Knapp <email@hidden>
- Date: Fri, 15 Feb 2002 13:44:27 -0500
OK, my brain is beginning to hurt, perhaps someone could do all my
work for me so I can go home? ;-)
I have a list, (let's call it foldList), of folder path-strings:
{ "MacHD:Projects:Project 1:Art:CHAP01:",
"MacHD:Projects:Project 1:Art:CHAP02:",
"MacHD:Projects:Project 2:Art:CHAP01:",
"MacHD:Projects:Project 2:Art:CHAP02:",
"MacHD:Projects:Project 2:Old:CHAP01:",
"MacHD:Projects:Project 2:Old:CHAP02:" }
An important property of this list to mention is that my script
has previously sorted it, such that:
( foldList's item x < foldList's item (x + 1) ) = true
What I want to achive is a string in this format:
"MacHD:
Projects:
Project 1:
Art:
CHAP01:
CHAP02:
Project 2:
Art:
CHAP01:
CHAP02:
Old:
CHAP01:
CHAP02:
"
where each indentation level is preceeded by an appropriate
number of tabs.
After several hours of playing with this, I've come to
realize that it is a lot harder than it looks to accomplish
this, as it seems to require several nested repeat loops
and a lot of maintaining of "state", or really complex
recursion that I just can't seem to work out the details of.
Thanks in advance. :)
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://www.seanet.com/~jonpugh/>
on error number -128
end try
}
_______________________________________________
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.