Recursive functions & getting lists
Recursive functions & getting lists
- Subject: Recursive functions & getting lists
- From: Mark Dawson <email@hidden>
- Date: Wed, 3 Dec 2003 13:37:29 -0800
I'm trying to handle both a folder of items being dropped on my script
and a single item; however, I'm somehow grabbing the file list from the
folder correctly. When I try to use the "loop" variable, after my
routine has been recursively called, I get an error ("Can't make
<<class docf.>>"filename" of <<class docf>>"directory" of ... (showing
the directory level hierarchy).
When my loop runs the first time (with a folder dropped on it or a
single file dropped on it), everything is fine; its has something to do
with the kind of list I'm making. What am I doing wrong?
Thanks!
on createBundle(Alist, level)
tell application "Finder"
repeat with loop in Alist -- loop is an item of Alist
display dialog "here:" & loop
if kind of (contents of loop) is "folder" then
if level is equal to 0 then -- only look one level down
set Blist to every item of loop <-- wrong way to set "BList"??
my createBundle(Blist, 1)
end if
else
_______________________________________________
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.