Check if file exists in a folder

Seasons greetings Opi Bretheren!

I have a script that moves and/or renames files which I use a lot.
Every now and again when I run it there is already a file of that name in the folder.
So I get a windows error to this effect.
I want to improve things by checking programatically if the desired name already exists.
From the JS default script I see I can peruse the current directory using a returned item object see screenshot.
Because I am lining up multiple renames for every selected file and then executing them using the command object, using this approach will be complex to implement.
It is not clear to me how best to approach.
Maybe this is the only way.


Would anyone have any suggestions or point me to any existing scripts that might do that or something similar?
Much appreciated

WHENEXISTS is not an option?!Documents/Copy.htm!Documents/Rename.htm

Ah that looks worth a read.... thanks @Ixp!