Pergunta

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

Foi útil?

Solução

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
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top