Re: What's the biggest barrier to wider AS adoption?
Re: What's the biggest barrier to wider AS adoption?
- Subject: Re: What's the biggest barrier to wider AS adoption?
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 23 Sep 2001 19:26:20 -0700
Rachel,
You can use the Standard Addition 'list folder' which will immediately give
the the _name_ of every file or folder one level in. You can put the names
back together with the path of their containing folder to get the full
paths.
You should know that 'entire contents' is the most notorious bug around:
when folders have lots of items it returns false results.
To get what you want easily and simply, get Akua Sweets scripting addition
free at
http://www.osaxen.com and put it in the Scripting Additions folder
in your System folder and restart your computer. Aside from what I'm about
to show you, it will repay you thousands of times over for its 200+ commands
. It will work anywhere ion AppleScript, in or out of any tell block. Spend
some time just perusing it.
When you get your folder theFolder as an alias, you can do this (do it
outside to Finder for speed and simplicity of result):
set theFiles to the entries in theFolder as alias to a depth of -1
That will get you every single file and folder at all levels, in alias form.
Easy enough? (check 'the entries in' for lots of other great parameters such
as 'whose kinds are ' , 'whose creators are ', etc, etc.
--
Paul Berkowitz
>
From: Rachel Cogent <email@hidden>
>
Date: Sun, 23 Sep 2001 20:09:33 -0600
>
To: Doug McNutt <email@hidden>,
>
<email@hidden>
>
Subject: Re: What's the biggest barrier to wider AS adoption?
>
>
Just for conversations sake, as an experienced DOS Batch programmer I guess
>
I was looking for something like DIR/S>textfile.
>
it seems a little bizarre that such a rudimentary operation requires mucho
>
gyrations to accomplish in AppleScript. Like McNutt said, I just want to get
>
things done and am completely open to alternatives. I have been playing with
>
OneClick but that also seems like a big deal. Is there anything remotely
>
like DOS commands?(hope that is not a dirty word here)
>
>
Rachel http://www.gnarlodious.com
>
>
Entity Doug McNutt spoke thus:
>
>
> Allow me to attempt to answer with a quote from another thread:
>
>
>
> At 18:23 -0600 9/23/01, Rachel Cogent wrote:
>
>> I am attempting to make a list of all the files in a folder and subfolders,
>
>> however the "entire contents of" returns an empty list. I have looked all
>
>> over the Finder dictionary how to do this. does it say this stuff anywhere
>
>> in plain language? Is this how it is, every little step of the way is a huge
>
>> obstacle? Please tell me there is a way to learn this stuff without posting
>
>> a question and waiting for every little modification.
>
>
>
> My personal biggest reason for not using AppleScript is the very
>
> simple lack of documentation. It is a pain in the proverbial donkey's
>
> butt to figure out just how to express yourself. "Natural English" is
>
> a joke. Raw C or C++ is easier to understand. Guessing what phrase
>
> will be understood is difficult and AppleScript is simply not
>
> capable, in a human sense, of second guessing what I have in mind
>
> when I speak the English I learned in 1940.
>
>
>
> In MPW this user's question is simple - two lines:
>
>
>
> directory diskname:directory:
>
> files
>
>
>
> or
>
> files -l # if you want to know a lot of details
>
> or
>
> files -r # if you want to delve into subdirectories
>
>
>
> and MPW is now free from Apple at:
>
>
ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_etc./MPW-GM_Im>>
a
>
> ges/
>
>
>
> MacPerl, and now real perl in OS neXt, are better. The MPW scripting
>
> language, though different from absolutely everyone else's, is at
>
> least documented.
>
>
>
> It is possible to create and then send interapplication communication
>
> events in C, MacPerl, perl, or MPW, but it's impossible to discover
>
> the appropriate codes from the "dictionary" of an application. It's
>
> equally impossible to guess just what verbiage will persuade
>
> AppleScript to execute without generating some obscure error.
>
>
>
> Object-oriented methods and classes may make sense somewhere but if
>
> you want a scripting language easily usable by people who just want
>
> to get things done they're simply not the right answer.
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users