
지금까지 나는 이것을 얻었습니다 :
property watch_folder : alias "Macintosh HD:Users:davidcuster:iFlicks:Watch Folder:"
tell application "Finder"
count files of entire contents of watch_folder
if the result = 0 then
quit
end if
end tell
나는 이 작업을 수행하는 더 쉬운 방법을 찾고 있습니다.
답변1
이것이 더 쉬운지는 모르겠지만 폴더의 하위 폴더에 많은 파일이 포함되어 있으면 전체 내용을 가져오는 것보다 빠릅니다.
tell application "Finder"
if items of (POSIX file "/Users/username/folder" as alias) is {} then
--
else
--
end if
end tell
Finder
로 대체할 수도 있습니다 System Events
. 어떤 이유로 Finder에는 숨겨진 파일이 포함되지 않지만 시스템 이벤트에는 포함됩니다.