Hi All,
I have a customer that has reported the following situatoin he needs help with:
"I have a bunch of menu programs and is there way to get the AutoGui to automatically trim the blank spaces on the values? Example when you click on the link the auto gui puts in ‘ 1’ instead of ‘1’. Reason is, half my menu options on numerous screens are entered in that way which means half my menu links don’t work."
I can't figure out how to solve this problem. I've tried editing the regular expression in the AutoGUI+ rules that build the menu items, but I can't figure out the correct syntax. Here is the shipped value: ^( *\d+)\.(?!\d+)(.*)$
I'm hoping to find any global solution that doesn't require me to go to each affected screen and make the change.
Any help would be appreciated.
Thanks, Luis
AutoGUI+ Menu Items
Moderator: jeanmichel
Re: AutoGUI+ Menu Items
Hi
If the menu item have an space, like " 1." instead of "1." , that expression in the Identification Rules should capture it and recognize it as a menu item, displaying it with the menu item image.
The problem then could be handled when it returns the menu value to the command line, which you can change in
AutoGUI Menu Item / properties / extension / value , you change it to script and place the following script there:
If the menu item have an space, like " 1." instead of "1." , that expression in the Identification Rules should capture it and recognize it as a menu item, displaying it with the menu item image.
The problem then could be handled when it returns the menu value to the command line, which you can change in
AutoGUI Menu Item / properties / extension / value , you change it to script and place the following script there:
Code: Select all
var valueText = FIELD.getValue().trim().replace(" ","");
ENV.returnValue = parseInt(valueText);-
LuisSantana
- Posts: 5
- Joined: 25 Jul 2017, 01:16
Re: AutoGUI+ Menu Items
Thank you very much. This might offer a good global solution. I can't test it on our system, since I don't have screens that behave like the cusotmers, but at least I have something to work with. I did notice that after I apply your change, some of the menu items on some of my screens were misaligned. See screenshot. Any idea if I can correct that globally as well? If not, I'll just tell the customer they need to manually change some screens. Thanks again.
-
Fairdinkum
- Posts: 128
- Joined: 24 Jul 2017, 17:02
Re: AutoGUI+ Menu Items
Hi Luis,
I encountered a similar problem, and solved it with the attached auto-gui rule. I'm not 100% sure if your problem is the same as mine, though, you can try this in your test environment when you have time. Just importing the attached .json file.
Hope this helps!
Regards,
Hide from Fairdinkum
I encountered a similar problem, and solved it with the attached auto-gui rule. I'm not 100% sure if your problem is the same as mine, though, you can try this in your test environment when you have time. Just importing the attached .json file.
Code: Select all
var menuNum = FIELD.getValue().split(".")[0].trim();
ENV.returnValue = Number( menuNum );
Regards,
Hide from Fairdinkum
- Attachments
-
- axautoguirules(trimMenuNumbers).zip
- (627 Bytes) Downloaded 494 times