Why is the type() function not executed in this script? - sikuli

I am new to Sikulix and I am running into a problem.
I am trying to follow a tutorial, but the type() function does not seem to work.
I am working on a windows 10 machine 64bit, with sikulix 1.1.3 IDE.
Below is an image of my simple script in which I try to start the calculator in windows.
Both clicks are executed, but the type is not. It also doesn't show up in the log screen:
Is this a bug or am I missing something?

Put a wait(1) right after the click
And do
type("Calc")
type(Key.ENTER)
The issue you're having is your type statement: type("calc" + Key.ENTER)
This should be avoided.
You could try type("calc", Key.ENTER) but I'm unsure if this works. Hope this helps!

I think this is a bug in 1.1.3.
I am running 1.1.0 on a 64 bit Windows 10 PC and this code worked fine for me. I have never had issues concatenating a Key with a String because in Sikuli most of the key constants are actually String values including Key.ENTER documented here.
Maybe try:
wait(image)
type(image, "calc" + Key.ENTER)
Using type this way will click the image and then type whatever is in the second parameter.
Side note for #Michell Monarch:
type("calc", Key.ENTER) will search for the text "calc" on the screen, click it, and then press enter

Related

PhpStorm disable hints after typing, enable method parameter hints

It's driving my crazy that every time I type a comma and than hit enter, some hinted method is inserted into my code because PhpStorm thought it should display a code hint. I only want hinting when I'm typing a variable or a method name, is this possible?
Also, I once saw some PhpStorm hinting that when the user typed a method name, PhpStorm displayed the required variables just above that method as a hint, but I can't find the setting for it.
I don't mean this, but I can't find an image of it:
Ah, I just found out it was probably some beta version of PhpStorm 2017.1, I downloaded the release today and instantly saw what I was looking for:

Sikuli Key.CTRL does not work

Using Sikuli IDE 1.0.1 (according to the "About SikuliX" menu).
Ubuntu 14.04.3, 64 bit, virtual server, via tightvnc + Xfce 4.
One day everything just stopped working though we did not change the sources. Server updates (ubuntu software) are off. Combinations like type('a', Key.CTRL) started to type plain 'a' char, not selecting a text (as before).
We even tried to spin up the same instance type, set everything up there, and run agian. And Sikuli failed to type "Ctrl" again!
We also tried to run the script with "-r", skipping IDE. Same thing - no Ctrl.
Can anybody help?
Thanks!
I suppose you should do it as sequential actions (like you actually do on your keyboard):
keyDown(Key.CTRL)
type("a")
keyUp(Key.CTRL)
Alternatively, you can use the KeyModifier.CTRL in the function type
type("a", KeyModifier.CTRL)
If you're using the
type('a', Key.CTRL)
to simulate holding CTRL and pressing the 'a' key, the method you're using has been depricated. It should more properly be
type('a', KeyModifier.CTRL)
as per the documentation.
Try that and see if that will solve your problem. :)

Sikuli ide special caracters :, \ doesn' t pass through

I am using Sikuli ide,
I want to do a very simple type("1440144711350.png", "C:\tests\exportDest.csv")
But it doesn' t seems to work, when i run it, i got errors, what' s the problem may be coming from ?
Thanks
From your code, I suppose you are trying to find or open a file from the windows explorer, or something similar.
The type function simulates the Standard US keyboard, can be tricky if you do not have one. Have a look to SikuliX documentation on the function type. You certainly then have to prefer the method paste
The second issue you certainly encounter is linked to the backslash that is interpreted in your string (for example \t is interpreted as tab). you have to escape them with a \\
To verify it: simply paste (Ctrl+V) in atext editor after running your script can provide you an idea what sikuli tried to paste...
paste("1440144711350.png", "C:\\tests\\exportDest.csv")
if needed you can simply press the enter key afterwards as following:
paste("1440144711350.png", "C:\\tests\\exportDest.csv")
type(Key.ENTER)

Has the Chrome console's autocomplete feature gotten more aggressive?

It seems like lately I have been having been getting hung up on the auto-completion drop down when using the console in Chrome DevTools. It seems like it has suddenly gotten more aggressive. I have never had a problem with the feature until the other day when I was trying to enter commands into the console quickly in order to test things. I wasn't sure why it wasn't working right. when I'd hit Enter auto-completion kept popping up and not executing what I typed. At first it seems as if auto-completion was activating whenever I would hit Enter to execute my code. However, it began to look like it was only popping up when I would end a statement with ;.
For example, typing the following statement into the console and pressing Enter would not cause the autocomplete drop down to activate:
console.log('did it')
However, if I add a semicolon then as soon as I press ; a number of milliseconds later the autocompletion feature immediately pops up:
console.log('did it');
At this point if I press Enter it will simply select the first entry, $, and add it as the next statement so we get:
console.log('did it');$
I know this is not really a big deal, after all, the only reason you would need the semicolon is for entering in multiple statements. However, I feel like in the past I've always added a semicolon ; to the end of simple single test statements such as the console.log shown above not activated the auto-completion, being able to execute it by just hitting Enter.
I definitely feel like my console's auto-completion is being activated more aggressive than it used to.
Has anyone else felt like the auto-completion in the console is activating too often all of the sudden? I am wondering whether or not this could have actually been changed in Chrome or if somehow I have made my console start acting this way with a setting or something?
While writing this I noticed that it seems not to only be after ; that auto-completion seems to pop up when it hadn't before. If you refer to Chrome DevTools - Using the Console you'll see that auto-completion is only referred to once:
The Console attempts to evaluate any JavaScript expression you enter at the shell prompt, upon pressing the Return or Enter key. The Console provides auto-completion and tab-completion. As you type expressions, property names are automatically suggested. If there are multiple properties with the same prefix, pressing the Tab key cycles through them. Pressing the right arrow key accepts the current suggestion. The current suggestion is also accepted by pressing the Tab key if there is only one matched property.
After this it goes on to say that we can use Shift+Enter in order to enter a multi-line expression and it gives the following example:
(source: google.com)
This is something I know for sure I have done plenty of times in the past with no problems from auto-completion. When I try to type the code in the above image I get as far as:
var add = function (val1, val2) {
Then when I press Shift+Enter instead of going to a new line like I am positive it did before (for me at least). Apparently anytime a new statement is started it will pop up. Has anyone else started getting highly annoyed at this feature as of very recently? Does anyone know if there's a way I could have caused this behavior?
Whoever answered my question before deleted their answer. I would like to close the question as it has been answered. This is indeed a bug as stated in the comments above and on the deleted answer. Anyone else that is here because they are experiencing problems as well will have to wait for the release to make it down to their version of Chrome, with Canary getting it first of course. You could presumably install an earlier version of Chrome to get around this as well. I know this is not directly about coding, but I see no reason to close it now when others may find the information useful.
Link to the Chrome Issue referencing this problem: https://code.google.com/p/chromium/issues/detail?id=263925

Getting a new chrome extension to work

Trying to get this to work: http://addyosmani.com/blog/autosave-changes-chrome-dev-tools/
I have never worked with node.js nor terminal before and could really use help..THANKS!!!
I followed the steps and I am getting an error through the extension that says URL (file://macintosh%20hd...it gets cut off) doesn't match RegExp /^file:VV(?localhost)?V/ this gets cut off too
This is way out of my league, I really appreciate your help, and I need some pretty detailed steps on what I need to do..THANKS!!!
I've fixed the chrome-devtools-autosave-server. You should install the latest version.