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:

Roberto Teixeira 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?

Fx Morin said...

you forgot the second
end tell