Question

How can I make some conditional actions only if a file doesn't exist?

I found the requirement check "If file exists" but not "If file doesn't exist".

Perhaps using an apple script in the pre-install check?

Thanks in advance for your help

Was it helpful?

Solution

Here's an example...

set someFile to (path to desktop as text) & "sample.txt"

tell application "Finder"
    if not (exists file someFile) then
        -- do something here
    end if
end tell
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top