Why is my applescript for checking if a file exists failing?
It looks like the Finder needs the absolute path to the home folder instead of the relative path. Instead of starting the path with ~/, it needs to start with /Users/username/.

Instead of hardcoding the username into the script, you can have AppleScript build the absolute path on the fly:

set homePath to POSIX path of (path to home folder)


Then you can replace "~/ with homePath &amp; " 

For example:

if exists "~/Downloads/Conversion/" &amp; cbUsername &amp; ".flv" as POSIX file then


would become

if exists homePath &amp; "Downloads/Conversion/" &amp; cbUsername &amp; ".flv" as POSIX file then


Alternatively, if you only use ~ with the path ~/Downloads/Conversion/, you could instead change that whole path to a variable:

set cbPath to POSIX path of (path to home folder) &amp; "Downloads/Conversion/"


Then the final script would be:

set cbPath to POSIX path of (path to home folder) &amp; "Downloads/Conversion/"

tell application "Finder"
    if exists cbPath &amp; cbUsername &amp; ".flv" as POSIX file then
        set x to 1
        repeat
            set newCbFilename to cbUsername &amp; "_" &amp; x as string
            if exists cbPath &amp; newCbFilename &amp; ".flv" as POSIX file then
                set x to x + 1
            else
                exit repeat
            end if
        end repeat
        copy newCbFilename to finalCbFilename
        display dialog "Filename already exists " &amp; "File will be named: " &amp; finalCbFilename &amp; ".flv" buttons "OK" default button "OK" with title "Error" with icon caution
    else
        copy cbUsername to finalCbFilename
    end if
end tell