AppleScript: Find all instances of "Folder" and list the contents in a drop down box/list I'm trying to make a script I can use to find all instances of a folder, be it on the root drive, external drive or mounted networked storage, and list all the contents in either a drop down box or a selectable list in a dialogue window.

To pseudo-code it:

tell application "Finder"
    for (every instance of "*/Folder"
        append items in "*/Folder" to contentsList
    end for
end tell


I honestly have no idea how to actually do it in AppleScript since it doesn't natively have for loops, and I'm not sure about adding items to arrays in AppleScript.

Is anyone able to give me any pointers? Alternatively, being able to do the same in a shell script would be just as good.

Thanks in advance!
set l to {}
tell application "Finder"
    repeat with f in (folders of entire contents of (POSIX file "/Users/username/" as alias) where name is "Folder") as alias list
        repeat with i in (get items of f)
            set end of l to POSIX path of (i as alias)
        end repeat
    end repeat
end tell
choose from list l




find ~ -name Folder -exec ls {} +




shopt -s globstar # bash 4.0 or later
printf %s\\n ~/**/Folder/*




mdfind 'kMDItemContentType==public.folder&amp;&amp;kMDItemFSName==Folder' -onlyin ~ |
while IFS= read -r l; do ls "$l"; done