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
Related
I created a dynamic action to capture selection changed event for an interactive grid.
On True I set Action to "Execute JavaScript" and put in one line
console.log(this);
When I make a selection nothing is printed out to the console
I tried here and works, do you did something diferent that this:
Example: https://apex.oracle.com/pls/apex/f?p=145797:8
The dynamic action is showed together with your IG region?
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]"
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);
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
I need help in figuring out the event that is fired when I select a dropdown value from dijit.form.Select. I already know of the onChange event and would like to know an event which fired even when the value is not changed.
Use Case
I am using dijit.form.Select in my project. I have some values like {Multiple,a,b,c,d} in this select drop down. When I select Multiple then it launches the pop up dialog. When I select other values a,b,c or d then that value gets set in that drop down.
Currently I catch onChange event to check if user has selected "Multiple" value so that I can launch the pop up dialog.
Now here is one issue. 1. Lets assume that by default selected value is a. 2. Now I select Multiple, onChange gets fired and pop up dialog gets launched. 3. Now again if I select Multiple then onChange event won't be fired and thus code would not launch pop up dialog.
I want to launch this dialog every time user selects "Multiple" value in the dropdown. Any suggestions to do this? I have tried useing onClick, onBlur and onFocus events but they are not of much use to me.
Please help.
You can Capture the 'onExecute' event of the dropDown of the dijit.form.Select widget for this behaviour. However, keep in mind that you wont get the newVal as an argument to the function for this event. to get the new value, use the following line as the first line of your function:
var newVal = this.focusedChild.option.value;
This will work for sure :)