KEYPRESS ENTER Imacros firefox doesn't work - keypress

What's wrong with this code? It is write a test, but it doesn't want to press the enter key.
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(4)>DIV>LABEL>INPUT" CHARS="test"
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(4)>DIV>LABEL>INPUT" KEY=13
Thanks

More details like site or htmlcode are helpful. Workaround is to press the 'Left Arrow' (=37) just before hitting the 'Enter' Key:
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(4)>DIV>LABEL>INPUT" CHARS="test"
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(4)>DIV>LABEL>INPUT" KEY="[37,13]"

Related

JavaFX: default button won't fire events

In my code I have bound the defaultProperty of a button to some other properties like so:
BooleanBinding isAddResourceButtonDefault
= resourceNameTextField.focusedProperty().or(
resourceTypeComboBox.focusedProperty()).or(
divisibleResourceCheckbox.focusedProperty().or(
maxInstancesTextField.focusedProperty()).or(
addResourceButton.focusedProperty()));
addResourceButton.defaultButtonProperty().bind(isAddResourceButtonDefault);
The problem is that the addResourceButton won't fire absolutely any events on pushing Enter - neither OnAction, nor OnKeyPressed.
The default property gets set just fine - I double checked (using output and ScenicView). ScenicView also doesn't show any events being fired upon hitting keys. Any ideas?
I believe TextFields (and other TextInputControls) process and consume key events that occur on them. So pressing Enter on a text field will not fire an action event on the default button (because the key event never reaches the Scene).
If you are just trying to fire the button's action event handler when enter is pressed in one of the text fields, just add the same event handler to the text fields. E.g.
EventHandler<ActionEvent> addResourceHandler = event -> {
System.out.println("Add resource");
// ...
};
addResourceButton.setOnAction(addResourceHandler);
resourceNameTextField.setOnAction(addResourceHandler);
maxInstancesTextField.setOnAction(addResourceHandler);

iMacros extracts only the first character from csv

iMacros script:
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !DATASOURCE Address.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
EVENT TYPE=CLICK SELECTOR="#text" BUTTON=0
EVENT TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL1}}
EVENT TYPE=KEYPRESS SELECTOR="#text" KEY=13
Csv File:
Numbers
123
456
Hi, I am a beginner with iMacros. When I go to http://www.editpad.org/ and run the above iMacros script, it is supposed to grab each number from every row and input in the textfield on the site. The issue is, it only extracts the first character!
Output:
14
EDIT 1: I Think it's the "CHAR=" TAG that's causing this issue. Is there any other TAG I can use? Unfortunately, I'm having to use the key-press method of recording because the tag-targetting method doesn't work in my case. Which is why I can't use the "CONTENT=" TAG, which I know works well for sure.
EDIT 2: I know that there's a CHARS TAG, but when I use that, only a white-space is extracted for some reason
Only one character is extracted this way, but I came up with a workaround:
I split every digit into separate columns. (you can do this with tricks using notepad++. Simply copy a column from Notepad++ and paste into Excel)
Then I appended zeroes to the numbers with fewer digits, eg: 7 became 0007.
So in the end it looked something like this:
A B C D
0 0 0 7
0 1 2 3
etc.
Then within the iMacros script, I used multiple keypresses, each time a different Column:
EVENT TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL1}}
EVENT TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL2}}
EVENT TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL3}}
EVENT TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL4}}
That did it for me as it fulfilled the purpose of this script.
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !DATASOURCE Address.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
EVENT TYPE=CLICK SELECTOR="#text" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL1}}
EVENT TYPE=KEYPRESS SELECTOR="#text" KEY=13
Try this code. I replaced EVENT with EVENTS.
Maybe the .csv is bad created.
With the script of #user1744228:
EVENT TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL1}}
EVENT TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL2}}
EVENT TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL3}}
EVENT TYPE=KEYPRESS SELECTOR="#text" CHAR={{!COL4}}
You can use this tool to create propper .csv files:
http://cetagram.co.nf/csv-file-creator/
It's a .csv file creator which puts the text in UTF-8 mode and creates out of it numbers or texts, which can be used for your macro
Try this code replaced EVENT with EVENTS and CHAR with CHARS

Opening a select2 in Imacro

Not sure if this is possible though but I'm trying to open a select2 and wanting to input some text so it can filter and eventually select an item.
VERSION BUILD=8810214 RECORDER=FX
TAB T=1
URL GOTO=http://ivaynberg.github.io/select2/
' selecting the select2 here '
Whenever I try to select the field it doesn't show up on imacro's.
I tried it out here: Example
Even with ' The basic ' it didn't show.
Any idea's?
I'm using Firefox.
Thanks in advance
Kind regards
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION:nth-of-type(3)>ARTICLE>DIV>P:nth-of-type(4)>DIV>A>SPAN:nth-of-type(2)>B" BUTTON=0
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>UL>LI:nth-of-type(3)>UL>LI>DIV" BUTTON=0
This code will click Arizona on the link you posted.
To make it changeable use JavaScript scripting and make the last digit in brackets changeable.
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION:nth-of-type(3)>ARTICLE>DIV>P:nth-of-type(4)>DIV>A>SPAN:nth-of-type(2)>B" BUTTON=0
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>UL>LI:nth-of-type({{!LOOP}})>UL>LI>DIV" BUTTON=0

how I can check the leave event is occured in other buttons click event in C#

I have called a leave event for a a text box and in it called another buttons event named Retrieve button. so now I just want to check in this retrieve button event weather the text box's leave event is called or not?
When you call the retrieve button event from the text box leave (blur) event you could simply add a flag into the eventArgs that you can check in the retrieve button. This flag would only be set when you implicitly call the retrieve button even from the text box leave event.
This would mean that if the retrieve event is called from other places the flag would not be set so you could tell that the call definitely came from the button leave event.

VB6 sending keypress to a textbox

Hey all, i am looking for a way to send a keypress letter/number to a textbox. The reason why i need this is that this textbox is a AutoComplete box that, when the user types, it displays a list of suggestions like google does.
However, for it to work, the user has to click in the box and type something. I can send any number/letter to the box i want using this code:
Private Sub Command_Click()
AutoComplete1.Text = "g"
End Sub
And it does put it into the textbox but it does not trigger the autocomplete list (the list has words like "good","great","pop","test"). Only when i click in the textbox and type "g" is the only time i get the "good","great" suggestions.
Is there a way to trigger this with the code i posted above?
Thanks!
David
Wouldn't
AutoComplete1.SetFocus()
SendKeys("g")
do that?
How about putting the code in the Key_Press event of the textbox instead of click event of the command button?
My guess would be to use Keyup event and fire the code that displays the list of suggestion if it isn't fired by the Keyup event itself

Resources