Page 1 of 1

AutoGUI+ Menu Items

Posted: 18 Jan 2022, 03:26
by LuisSantana
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

Re: AutoGUI+ Menu Items

Posted: 19 Jan 2022, 01:31
by Dino
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:

Code: Select all

var valueText = FIELD.getValue().trim().replace(" ","");
ENV.returnValue = parseInt(valueText);
menuitem.jpg
menuitem.jpg (180.2 KiB) Viewed 5905 times

Re: AutoGUI+ Menu Items

Posted: 19 Jan 2022, 04:52
by LuisSantana
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.
Here is what my LANSA Main System Menu Now Looks Like
Here is what my LANSA Main System Menu Now Looks Like
LANSAMainSystemMenu.JPG (51.75 KiB) Viewed 5902 times

Re: AutoGUI+ Menu Items

Posted: 26 Jan 2022, 14:27
by Fairdinkum
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.
Image 2186.png
Image 2186.png (143.81 KiB) Viewed 5867 times

Code: Select all

var menuNum = FIELD.getValue().split(".")[0].trim();
ENV.returnValue = Number( menuNum );
Hope this helps!

Regards,
Hide from Fairdinkum