Here is a version that puts the trailing "/" on folders and adjusts the input
parameters for the function.
-- Peter
Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig
--
function directoryListing pWhatFolder, pInvisibleFiles, pDepth
-- returns a full listing of
When I set the depth to 1 all I would get
is the pWhatFolder but 2 would list the
files at level 1.
JB
> On Oct 30, 2015, at 5:57 AM, Peter M. Brigham wrote:
>
> Here is a version that puts the trailing "/" on folders and adjusts the input
> parameters for the function.
>
"there is a folder" and "there is a file" can distinguish between the two.
Obviously if you want to distinguish visually for the user, or to do it
without testing, then including the trailing "/" would work.
On Wed, Oct 28, 2015 at 1:51 PM, Michael Doub wrote:
> When I saw
For me it made more sense to change the exit value to 1. That way the value
is the number of layers you want *including* the directory you specify. So:
put directoryListing("/Users/gcanyon/Desktop",1)
-- puts /Users/gcanyon/Desktop
That way using either 0 or empty gets the infinite list.
The
Sounds like just the fact that you don't have the scrollbar I used to
experiment with the depth. The mouseUp code is just for testing -- the
function is self-contained.
gc
On Tue, Oct 27, 2015 at 4:32 PM, JB wrote:
> I was not able to get the mouseUp handler to
> work but
Thank you for the info.
JB
> On Oct 28, 2015, at 7:46 AM, Geoff Canyon wrote:
>
> Sounds like just the fact that you don't have the scrollbar I used to
> experiment with the depth. The mouseUp code is just for testing -- the
> function is self-contained.
>
> gc
>
> On
When I saw that the output contained both directories and files, adding
the "/" allows you to
easily know that you are looking at a folder rather than a file.
put directoryListing(whatfolder) into foo
repeat for each line x of foo
if char -1 of x = "/" then
put x & cr after directoryList
Here is a different mouseUp handler you
can put in a field.
on mouseUp
if target = empty then
answer folder "Pick a folder you want to walk:"
put it into whatFolder
set cursor to watch
put directoryListing(whatFolder,2) into target
exit to top
end if
if the
I improved the mouseUp handler. Now you can set
the desired level at the top of the handler and you
can launch applications and folders in the finder.
on mouseUp
put 1 into cNum
if target = empty then
answer folder "Pick a folder you want to walk:"
put it into whatFolder
Revised. Now in function form, with error checking and depth control. You
can hand in a positive number to get that number of layers deep, or a
negative number to go all the way down. I tested it on my home directory
and it came back fine (after some time). I haven't (knowingly) tested with
Thank you, Geoff
JB
> On Oct 27, 2015, at 9:18 AM, Geoff Canyon wrote:
>
> Revised. Now in function form, with error checking and depth control. You
> can hand in a positive number to get that number of layers deep, or a
> negative number to go all the way down. I tested it
Geoff,
I would suggest replacing the first statement of the function with
if c is empty then put -1 into c-- set the default to go all the way
down
put whatFolder & "/" & cr into R -- add a "/" to directory output so
they are more easily parsed later
-= Mike
On 10/27/15 12:18 PM,
I was not able to get the mouseUp handler to
work but I got the function to return a list but it
probably not the same list. I used this.
on mouseUp
answer folder "Pick a folder you want to walk:"
put it into whatFolder
--put directoryListing(fld "directory",round(the thumbposition of
If you have already put a directory listing in
a field and want to click a line to get the list
of that line you can put this code in the field.
on mouseUp
put word 2 of the clickline into tLine
put line tLine of target into whatFolder
put directoryListing(whatFolder,2) --into fld id
I have been testing it out and it is working good
so far. I set the cursor to watch after selecting.
I am not sure if setting it to busy in a repeat will
take too much time on large operations.
Is there and easy way to have it only list the
folder paths?
JB
> On Oct 25, 2015, at 3:39 PM, Alex
On Sat, Oct 24, 2015 at 7:28 PM, Matthias Rebbe | M-R-D <
matthias_livecode_150...@m-r-d.de> wrote:
> I am using a script snippet which was posted by Scott Rossi to the list
> and was originally from Geoff Canyon in 2002.
> http://lists.runrev.com/pipermail/metacard/2002-August/002274.html
>
Well, it's a sad comment on my filing system, but it was easier to
rewrite this handler from scratch (and memory) than it was to find the
original :-)
Note this is done as a handler rather than a function, because it has 3
return values - a list of files, a list of folders, and a list of any
THANK YOU VERY MUCH, Alex.
JB
> On Oct 25, 2015, at 3:39 PM, Alex Tweedly wrote:
>
> Well, it's a sad comment on my filing system, but it was easier to rewrite
> this handler from scratch (and memory) than it was to find the original :-)
>
> Note this is done as a handler
Thanks for all your comments.
Richard was right, my recursion limit error was caused by the fact that the
directory could not be set.
It was, like Alex assumed, a strange character in a folder. After i changed
that folder name in my “sample” harddrive i was able to import the drive.
In
Okay - Thank you very much again!
JB
> On Oct 25, 2015, at 6:09 PM, Alex Tweedly wrote:
>
> I'm not sure about cursor setting - you might put in a counter, and set it to
> busy every 1000 (or 10,000) times through loop.
>
> What if we want only folder paths ?
>
> I did
Matthias Rebbe wrote:
long time ago i created a program which creates a list of files of backup cds
or dvds and stores that listings in a database with some additional information
like cd name/number.
So if the customer needs to know on which cd/dvd a needed fileis, the database
can be
Hi,
long time ago i created a program which creates a list of files of backup cds
or dvds and stores that listings in a database with some additional information
like cd name/number.
So if the customer needs to know on which cd/dvd a needed fileis, the database
can be searched. This worked
Are you sure you are actually hitting a recursion limit ?
Another (perhaps more likely) problem is that you are hitting a
protected directory, or one which you cannot access (e.g. because of
strange character in name).
I would (at a minimum) put in a check that you have moved to the folder:
> On Oct 24, 2015, at 5:33 PM, Alex Tweedly wrote:
>
>
> If that's not it, then you need to change to a serialized rather than a
> recursive treewalk - I'm sure that's been posted on the use-list some time
> ago (if you can't find it, let me know and I'll dig one up)
>
>
24 matches
Mail list logo