Re: Where is the Missing Link?
Re: Where is the Missing Link?
- Subject: Re: Where is the Missing Link?
- From: "Marc K. Myers" <email@hidden>
- Date: Tue, 25 Sep 2001 13:21:57 -0400
- Organization: [very little]
>
Date: Tue, 25 Sep 2001 08:32:09 -0600
>
Subject: Where is the Missing Link?.
>
From: Rachel Cogent <email@hidden>
>
To: "AppleScript (Gnarlodious)" <email@hidden>
>
>
Last by 2 AM I finally became frustrated to tears at how to do this most
>
rudimentary operation in AppleScript Which 2 days ago I described in DOS
>
batch terms:
>
DIR/s>textfile
>
This command makes a directory list of all files and all files in all
>
subdirectories and writes the output to "textfile".
>
>
I must have wasted 16 hours in the last few days trying to do this
>
operation.
>
There must be a way to do this in simple AppleScript, please don't recommend
>
I buy Script debugger, I am on social security and have hardly any money.
>
Yesterday after reading the praises of AppleScript I was willing to forgive
>
and forget, but now I am as disgusted as ever. This is not even a request
>
for help, just an expression of my failure to understand the rules of this
>
most difficult of languages. Besides wanting to actually get something done,
>
I am struggling to learn this stuff and failing miserably.
>
Today I will download this ASLG, maybe that is the missing link.
As with most things that have enough depth to be interesting,
AppleScript has a learning curve. I think you're expecting to be able
to do too much too fast. Picture a toddler sitting on the sidewalk
having a screaming fit because he can't run. Next year you won't be
able to catch him!
I wrote a script to accomplish what I think you want. It uses the Jon's
Commands scripting addition and Tex-Edit Plus. You could adapt it to
use any scriptable text editor or word processor, or even make it work
using AS's built-in "write" scripting addition. It's set up to be run
as a droplet or by double-clicking its icon.
on run
open ({choose folder with prompt "Which folder?"})
end run
on open (theInput)
script Marc
property fileList : {}
on open (aFile)
set tFile to aFile as string
set AppleScript's text item delimiters to {":"}
set theText to text item -1 of tFile & tab & (text items 1
thru -2 of tFile) & ":" as text
set AppleScript's text item delimiters to {""}
set fileList to fileList & theText
return fileList
end open
end script
set theList to walk folders theInput with script Marc without invisibles
tell application "Tex-Edit Plus"
activate
make new window at beginning
set theText to ""
repeat with aName in theList
set theText to theText & aName & return
end repeat
copy theText to after the contents of window 1
end tell
end open
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[9/25/01 1:21:46 PM]