If-Then-Else not doing what I want

I have an If-Then-Statement similar to the following:

if file ("ABC123.jpg") ends with "123.jpg" then
	duplicate file ("ABC123.jpg") to BertsFolder
else
	duplicate file ("ABC123.jpg") to ErniesFolder
end if

The end result is that ABC123.jpg is duplicated to both folders (BertsFolder and ErniesFolder). Why would this happen when?
Doesn’t the else portion mean “Do this if file ABC123.jpg does not end with 123.jpg?”
slimjim5811

Hi, Jim.

I think you should be testing the name of the file. :slight_smile: