Re: Path-Strings to Formatted String
Re: Path-Strings to Formatted String
- Subject: Re: Path-Strings to Formatted String
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 15 Feb 2002 13:40:50 -0800
Recursion, yes. I'm sending you a set of script handlers which does
something similar for the Entourage mail folder list, where subfolders are
indented to the correct level, and provides a unique solution for choosing
from list even where subfolders of different folders have the same name.
It took many repeated efforts, over several scripts, to get this right. Not
easy at all, as you say.
There will be some extraneous stuff to remove, but the method will work.
--
Paul Berkowitz
>
From: Arthur J Knapp <email@hidden>
>
Date: Fri, 15 Feb 2002 13:44:27 -0500
>
To: <email@hidden>
>
Subject: Path-Strings to Formatted String
>
>
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.
_______________________________________________
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.