Вопрос

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

Это было полезно?

Решение

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
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top