• 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
Recursive functions & getting lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Recursive functions & getting lists
      • From: Graff <email@hidden>
  • Prev by Date: Re: Panther Font Mania (was Quark 6 Font Mess)
  • Next by Date: Re: Panther Font Mania (was Quark 6 Font Mess)
  • Previous by thread: RE: Panther Font Mania (was Quark 6 Font Mess)
  • Next by thread: Re: Recursive functions & getting lists
  • Index(es):
    • Date
    • Thread