0

So far I've got this:

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

I'm looking for an easier way to do this.

1
  • Can you tell us why it must be an Applescript for some simple work also an Automator Action is enough. If it is more complex maybe a shell script will serve you better than an Applescript. Sometimes also a Combination is best. So to help you finding the easiest way to do something you should tell us what you will do.
    – konqui
    Dec 28, 2013 at 10:40

1 Answer 1

2

I don't know if this is any easier, but it's faster than getting the entire contents if the folder contains many files in subfolders:

tell application "Finder"
    if items of (POSIX file "/Users/username/folder" as alias) is {} then
        --
    else
        --
    end if
end tell

You can also replace Finder with System Events. For some reason Finder doesn't include hidden files but System Events does.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .