• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Path-Strings to Formatted String
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Path-Strings to Formatted String
      • From: Jason Bourque <email@hidden>
    • Re: Path-Strings to Formatted String
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: "on run" & "on re-run"
  • Next by Date: Re: Applescript & Microsoft IE
  • Previous by thread: Re: Directing "do script with command" to existing Terminal window
  • Next by thread: Re: Path-Strings to Formatted String
  • Index(es):
    • Date
    • Thread