If Then Else (I go crazy)

:stuck_out_tongue:
Im using a script that will find a file (image) based from its curent path, and the place it into Quark.
I got it to place in, but I cant seem to get it to work with an if statement.
I’d like to get it to stop or display a dialog box saying it can’t find it.
(such a simple function, and I can’t get it to work)
basically:
tell application
set Thepath to (where the file is)
if the path = true
Do rest of script
end if
stop script/display dialog
end tell

I also tried
If file thepath exists then

Can anybody see what I’m doing wrong, and set me right on the path to sanity?

This is a very common way:

try
	"path:to:file" as alias
	--> exist, continue...
on error
	--> doesn't exist
end try

Hello.

Just so you know, usually, in if statements you don’t use the “=” symbol.
you would do

set hi to true
if hi then
	display dialog "hi is true"
else
	display dialog "hi is false"
end if

or

set hi to "hi"
if hi is "hi" then
	display dialog "hi is \"hi\""
end if

I hope this helps.

As already noted, the Code Exchange forum is for posting full snippets/solutions. In the future, please use the other forums for help requests. This post will be moved.

There is nothing wrong with using the equals sign or the does not equal sign.

get "winner"

if result ≠ "winner" then
	return "Maybe next time."
else
	return "You did it!"
end if

See also: Operators