Reputation: 653
I have the following script that list the contents (files and folder) of a folder
set the_files to (list folder (choose folder) without invisibles)
e.g folder root has a file text1.txt and folders subroot2 and subroot3
but how can I get just the file name (only text1.txt) of a folder root (exclude subroot2 and subroot3)? thanks
Upvotes: 1
Views: 935
Reputation: 27633
tell application "Finder"
files of folder (choose folder) -- Finder file objects
name of files of folder (choose folder) -- names of files
end tell
Upvotes: 1