dealing with files that arnt there

copy (read the file "Macintosh HD:Applications:Read Me") to thisfile

if it dosnt exist then
display dialog this file

lets say i wanted to load this file, and read its contents, but if it dosnt exist i want to be able to skip whats next

You might be able use a "try / on error’ statement in your script, something like this…

--your script goes here
	end if
on error number error_number
	if the error_number is -128 then error number -128
end try

Hope this helps?

In this particular situation you might check first for file’s existence, because if you try to “read” the file, you must before “open for access” this file and, if it does not exist, it will be created on-the-fly. It will throw a different error “end of file error” when you attempt to read it, and you’ll have a new file created every time it doesn’t exist…
I’d follow this way:

	set x to alias "HD:Users:j:desktop:file.txt" --> throw error if it doesn't exist

	set z to (open for access x without write permission)
	set k to (read z)
	close access z
on error
	--> doesn't exist
end try