← Back to team overview

sikuli-driver team mailing list archive

Re: [Bug 1420866] Re: [1.1.0] Need IDE settings to overwrite captured images

 

Hi Collin,

I have to admit, that I stopped in the middle (from your point of view
).

I implemented this feature, but did not yet add it as a selectable
option.

Currently you have 3 possibilities:

-- 1. a hack
When having the IDE open, just add an untitled/new tab, that only contains

Settings.OverwriteImages = True

and run it once.
>From now on until you close the IDE you will have overwrite-images active
This would have to be repeated after every IDE startup.

-- 2. options file - longterm solution
this is not yet documented.
as mentioned in the docs
http://sikulix-2014.readthedocs.org/en/latest/basicinfo.html#sikulix-system-specifics <http://sikulix-2014.readthedocs.org/en/latest/basicinfo.html#sikulix-system-specifics>
SikuliX 1.1.0+ now uses a data store area, that contains a folder (create it, if it does not exist)
SikulixStore

In this folder put a file named
SikulixOptions.txt

that contains this line
Settings.OverwriteImages on

This file is read on startup and interpreted according to the rules of a
Java Preferences file.

-- 3. implicit image naming using imagename =
If you write into a scriptline only this:
imagename = 

and then press capture button still having the cursor in that line, then after capture you will have
imagename = "imagename.png"

this option always overwrites the image without asking.
Depending on how you have setup your script and usually work with naming, this might be interesting for you, since it is an easy way to name an image along a naming concept and have variables for the images all in one step.

One more thing:
if an image name starts with an _ then it will never be deleted by the cleanup function on save.
This is for situations, where you store captured stuff or other image files in the bundle, that are not mentioned anywhere in the script text.

Raimund
 
> On 11 May 2015, at 23:06, Collin Tobin <coljtob@xxxxxxxxx> wrote:
> 
> I am running Sikuli 1.1.0.... I have a utilities.py that runs most of my
> common functions.
> 
> I've included this line at the top:
> 
> Settings.OverwriteImages = true/1
> and also tried
> Settings.OverwriteImages = true/1
> 
> When I capture a pre-existing image, Sikuli names it with a "-1" and
> doesn't overwrite by the same name.
> 
> Am I missing something? And I thought using Settings in a script only
> affects the runtime behavior, what if I'm just capturing straight out of
> the IDE?
> 
> Thanks,
> 
> Collin
> 
> 
> On Mon, May 11, 2015 at 4:37 PM, RaiMan <rmhdevelop@xxxxxx> wrote:
> 
>> look http://sikulix.com
>> 
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1420866
>> 
>> Title:
>>  [1.1.0] Need IDE settings to overwrite captured images
>> 
>> Status in Sikuli:
>>  Fix Committed
>> 
>> Bug description:
>>  Would like the option of a setting to overwrite images of the same
>>  name during the screen capture process.
>> 
>>  Using Sikuli IDE 1.0.1 / Win 7 64 bit.
>> 
>>  From an earlier thread with
>>  RaiMan:(https://answers.launchpad.net/sikuli/+question/261956)
>> 
>>  I will add an option
>>  Settings.OverwriteImages = false (as default)
>> 
>>  So when available in one of the next nightly builds of 1.1.0, you might
>> try it out:
>>  somewhere at the beginning of a script session simply say
>>  Settings.OverwriteImages = true
>> 
>>  and on recapture the images will be overwritten without notice (since
>>  you know, what you are doing).
>> 
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/sikuli/+bug/1420866/+subscriptions
>> 
> 
> -- 
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1420866
> 
> Title:
>  [1.1.0] Need IDE settings to overwrite captured images
> 
> Status in Sikuli:
>  Fix Committed
> 
> Bug description:
>  Would like the option of a setting to overwrite images of the same
>  name during the screen capture process.
> 
>  Using Sikuli IDE 1.0.1 / Win 7 64 bit.
> 
>  From an earlier thread with
>  RaiMan:(https://answers.launchpad.net/sikuli/+question/261956)
> 
>  I will add an option
>  Settings.OverwriteImages = false (as default)
> 
>  So when available in one of the next nightly builds of 1.1.0, you might try it out:
>  somewhere at the beginning of a script session simply say
>  Settings.OverwriteImages = true
> 
>  and on recapture the images will be overwritten without notice (since
>  you know, what you are doing).
> 
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/sikuli/+bug/1420866/+subscriptions

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1420866

Title:
  [1.1.0] Need IDE settings to overwrite captured images

Status in Sikuli:
  Fix Committed

Bug description:
  Would like the option of a setting to overwrite images of the same
  name during the screen capture process.

  Using Sikuli IDE 1.0.1 / Win 7 64 bit.

  From an earlier thread with
  RaiMan:(https://answers.launchpad.net/sikuli/+question/261956)

  I will add an option
  Settings.OverwriteImages = false (as default)

  So when available in one of the next nightly builds of 1.1.0, you might try it out:
  somewhere at the beginning of a script session simply say
  Settings.OverwriteImages = true

  and on recapture the images will be overwritten without notice (since
  you know, what you are doing).

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1420866/+subscriptions


References