Applescript testing for file existence

Viewed 31616

OK, I thought this would be a simple one, but apparently I'm missing something obvious. My code is as follows:

set fileTarget to ((path to desktop folder) & "file$") as string

if file fileTarget exists then
    display dialog "it exists"
else
    display dialog "it does not exist"
end if

Easy right? Unfortunately, when I run the script it returns the error

Can’t get file "OS X:Users:user:Desktop:files$".

It doesn't matter if the file exists or not, this is the same error I get. I've tried a dozen different things but it still stumps me.

3 Answers
Related