문제

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