Launch Script Editor

Get the list of folders inside a folder

tell application "Finder"
    get name of folders of folder ("/Library/Desktop Pictures/" as POSIX file)
    
    -- Returns: {"Abstract", "Black & White", "Nature", "Plants", "Solid Colors"}
    
end tell


tell application "Finder"
    get name of folders of folder "Library:Desktop Pictures" of startup disk
    
    -- Returns: {"Abstract", "Black & White", "Nature", "Plants", "Solid Colors"}
    

3 comments:

Anonymous said...

Mr. Green Man, you rock!h

Anonymous said...

great code. one question - how do you store these in an array? or how do you use/call them individually?

fxmorin said...

you forgot the second
end tell