Did "Export as executable" and cannot edit the script anymore --- save as .sikuli first

Asked by joao

Hi, I'm new to Sikuli and I believe I made an error when saving my first script. Saved it as an exe and as a py, whatever py is, but forgot or didn't know I had to save it as a .sikuli for future editing. I'm now wondering if it's possible to edit these two or will I have to remake a new script from nothing? Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
joao
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Rename the folder some-name.exe to some-name.sikuli and take care that the contained .py file (it contains your script) is named the same (means: some-name.py). Additionally, the folder should contain a .html file and the images that you captured as .png.

Then it should be possible, to reopen the script in the IDE.

Revision history for this message
joao (joaodedeus1) said :
#2

Either when I save, save as, or export as executable, it saves them and I can see and use the executable, and I can see the .py file just like you said it'd be. But the Sikuli IDE, and the Sikuli IDE.exe won't recognize them.

When I go to 'Open file' inside Sikuli, it only wants to see .sikuli files, but it just won't see the ones I've saved,.

The solution is indeed very odd; it can only be opened from outside. You have to left click the .py file and select sikuli to open it with.

The more serious downside, which I'd appreciate you can help me with, is when I do open the file, instead of seeing images in the brackets, I see the .png file names, so I lose a great sense of knowing exactly where I am in the script. This is very clumsy either of me or of sikuli's setup.

Revision history for this message
joao (joaodedeus1) said :
#3

Either when I save, save as, or export as executable, it saves them and I can see and use the executable, and I can see the .py file just like you said it'd be. But the Sikuli IDE, and the Sikuli IDE.exe won't recognize them.

When I go to 'Open file' inside Sikuli, it only wants to see .sikuli files, but it just won't see the ones I've saved,.

The solution is indeed very odd; it can only be opened from outside. You have to left click the .py file and select sikuli to open it with.

The more serious downside, which I'd appreciate you can help me with, is when I do open the file, instead of seeing images in the brackets, I see the .png file names, so I lose a great sense of knowing exactly where I am in the script. This is very clumsy either of me or of sikuli's setup.

Revision history for this message
joao (joaodedeus1) said :
#4

Also, when I edit a py file, how can I export it to a new exe of my choice? No matter where I try to export as executable the py file just won't convert into something that is usable, like an exe file.

Revision history for this message
RaiMan (raimund-hocke) said :
#5

--1. If you want to edit a Sikuli script again, you have always to save it as a .sikuli first. You never touch the contained .py. You always work on the folder level .sikuli, when using the IDE. Then Sikuli has access to the script and the images. That is the normal usage. "Export as executable" is not intended to be an alternative to "Save as", but as a format for "run-only".

--2. "executable" might be missleading. It has nothing to do with .exe, it is only a zipped version of the .sikuli folder. So you might see the .py, when looking at the .skl, because you see the content of the zipped file.
With the release X-1.0 the executable format is not really needed any longer, because you can use the .sikuli with all command line approaches as well.
The format .skl is convenient, if you want to give your script to someone else via mail or web upload, because it is one file instead of a folder containing many files.

--3. If you only have a .skl, just change .skl to .zip, unzip it to a folder that you rename to myscript.sikuli - and here you are again. myscript has to be the same as for the contained .py. feel free to rename both to have the same name.

Revision history for this message
joao (joaodedeus1) said :
#6

''If you want to edit a Sikuli script again, you have always to save it as a .sikuli first. You never touch the contained .py. You always work on the folder level .sikuli, when using the IDE. Then Sikuli has access to the script and the images. That is the normal usage. '

But save as sikuli (source files) is the only option anyways, so how am I not saving this as a sikuli file in the first place? I'm still getting an uneditable and unworking file when I save as and save as they become the PY file in a folder we're talking about. The only time it works is as an executable but then it can't be edited later on.

If you mean save as name.sikuli (despite already having that indicated in the 'files of type' area, I've also tried that...

And the files to be edited give me y.png instead of the image.png, but the major problem now is knowing why it won't allow files to be edited in the future or why py files won't work when in the editing room.

Revision history for this message
joao (joaodedeus1) said :
#7

Ok, got it thanks. It works by opening Sikuli first, then going to open and even though the file doesn't appear there it does appear in the 'file name'. Now it's working fine and with the pictures to be seen. It didn't work by selecting the py file and open as sikuli.