[1.1.0] variable = <automatic image file name> overwrites existing images --- is by intention
So in SikuliX 1.1, there seems to be a neat new feature which automatically sets the name of a new image capture to be same as variable name if you capture the image while the cursor is after the equals sign (ie, when the cursor is on the right side of "Menu = ", the image I capture will automatically be named to Menu.png).
However, this potentially has the unintended consequence overwriting any existing image in the bundle that already has the same name. I've encountered this myself when I tried to set a switch of using different images depending on the platform tied to the same variable name. Say I intended to do something like:
if not "10.11" in Settings.
Menu = Menu.png
Menu = Menu1011.png
When I try to do the capture for the second Menu statement, it ends up overwriting the image in the first Menu statement because of the automatic rename.
I think what's needed here is a check to make sure the image doesn't already exist in the bundle before setting the name for the new image, and using naming convention like a Menu(1).png, Menu(2).png, etc, if there are existing ones. Or alternatively, make it an explicit option in the Screen Capturing preferences panel so someone can disable it if it does give them problems.
|Changed in sikuli:|
|status:||New → Won't Fix|
|assignee:||nobody → RaiMan (raimund-hocke)|
|milestone:||none → 1.1.0|
- Automatic image file names can accidentally overwrite existing images
+ [1.1.0] variable = <automatic image file name> overwrites existing
+ images --- is by intention