What I want to do in this project is:
- Get text out of a TextInfo variable, and
- Use a Message Box with a timeout
While reading While reading @ddpadil’s thread about message box timeouts, I thought of AutoHotkey’s message box, which does have a timeout.
What brought me there was @murali38’s post about finding multi-word text with “Find text position.” This led me to the TextInfo activity, which I’m still delving into.
While working on the WordsInfo output (see the workflow), I found I needed that timeout on a message box (see above), not for functionality but to make an animated GIF without driving myself nuts.
There’s not much to the workflow - the critical part is below:
Since you can’t see what’s in the Expression Editor, here it is:
I found this output interesting. In the animated GIF below, you’ll see what it does with the element that contains this, which is from UiPath dynamic array documentation.:
If you want to work with a collection that doesn't have a fixed number of elements, you can use a list instead of an array.
(The sharp-eyed among you will notice that the individual GIF for the word “list” didn’t make it into the final result. I think it’s due to making the FPS setting on my screen capture too low. You’ll see it when you run the workflow, though.)
It appears that it ignores spaces except when there’s a comma, in which case it considers the space after it a … well, an “item”, I suppose.
I suspect this MAY have something to do with the reason “Find text position” chokes on spaces, but maybe not.
Although the reason I wanted a timeout was to just to make preparing the animated GIF easier, it might be useful elsewhere to someone.
The very short AHK script attached takes two arguments, the item text from each iteration of the “for each” loop, and the delay time (which counter to what you’d think is passed as a string).
If you look at the AHK script, you’ll see you can modify it put a caption on your message box, and add a delay. There are other options, but these are the ones I’ve passed as arguments from the workflow.
The workflow is ‘WordInfoTest_1.xaml’; the AutoHotkey script is ‘TimeoutMB.ahk’
Timeout.zip (3.2 KB)