我有以下脚本列出文件夹的内容(文件和文件夹)
set the_files to (list folder (choose folder) without invisibles)
例如,文件夹根目录有文件text1.txt和文件夹subroot2和subroot3
但是如何才能获得文件夹根目录的文件名(仅text1.txt)(不包括subroot2和subroot3)?感谢
答案 0 :(得分:1)
tell application "Finder"
files of folder (choose folder) -- Finder file objects
name of files of folder (choose folder) -- names of files
end tell