• 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
Re: Process nested folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Process nested folders


  • Subject: Re: Process nested folders
  • From: "Marc K. Myers" <email@hidden>
  • Date: Mon, 04 Dec 2000 18:17:10 -0500
  • Organization: [very little]

Brad wrote:
> Date: Mon, 04 Dec 2000 10:59:07 -0800
> Subject: Process nested folders
> From: Brad <email@hidden>
> To: AppleScript list <email@hidden>
>
> Hello,
>
> I have a folder hierarchy for which I want to set window properties.
> Below is a script that works if I drag group of folders onto it.
> What I am looking for is to be able to drag the parent folder
> to the droplet and process all nested folders.
>
> I have adapted this script from AppleScript help modules.
>
> **************
>
> -- This droplet processes folders dropped onto the applet
> on open these_items
> repeat with i from 1 to the count of these_items
> set this_item to item i of these_items
> set the item_info to info for this_item
> if (alias of the item_info is false) and ,
> (folder of the item_info is true) then
> process_item(this_item)
> end if
> end repeat
> end open
>
> -- this sub-routine processes folders
> on process_item(this_item)
> -- NOTE that the variable this_item is a folder reference in alias
> format
> -- FOLDER PROCESSING STATEMENTS GOES HERE
> tell application "Finder"
> activate
> open this_item
> set position of container window of this_item to {100, 100}
> set size of container window of this_item to {400, 400}
> set view of container window of this_item to name
> close this_item
> end tell
> end process_item

This is the approach I would use:

on run
open ({choose folder})
end run

on open (itemList)
repeat with anItem in itemList
set theItem to the (contents of anItem) as text
if character -1 of theItem is ":" then
tell application "Finder"
set newList to items of alias theItem
end tell
open (newList)
procFldr(theItem)
end if
end repeat
end open

on procFldr(theFldr)
-- do something with the folder
end procFldr

Marc [12/4/00 6:16:47 PM]


  • Prev by Date: Re: Quitting an Applet II
  • Next by Date: Re:Quitting an Applet II
  • Previous by thread: Process nested folders
  • Next by thread: Re: Process nested folders
  • Index(es):
    • Date
    • Thread