oScript.InvokeButton("xxx") Alternative in BOI Script

I am using a BOI script to check if the Unattended Barcode Import Task is running. If it is not running, the script starts up the UI for Unattended Barcode Import.

But I need to programmatically press the "Proceed" Button in the UI. Any ideas?

Is there an oScript.InvokeButton alternative in BOI and if so, how would I use this? The script pauses once the UI opens up.

Thanks for your help!

Best,

B.

  • 0

    I assume you're talking about a response to a button click, rather than a User Defined Script.  If the script is running on the server, you can still call oScript.InvokeButton.  If it's running on the client, you can use good old WShell to send any key strokes you need to the active window.  So you'd just need to make sure the button in question has a keyboard shortcut defined for it, then do something like this:

    Set ss = CreateObject("WScript.Shell")

    ss.SendKeys "%X"

    Set ss = Nothing

    Hope that helps.

    Aaron

  • 0 in reply to FunkMonkey33

    Hi Aaron, 

    Thanks for your reply. The script is triggered by the Task Scheduler on the server. I am not sure how the Invoke Button would work. The script pauses once the UI opens up. Is there a way to open a Sage Task through BOI and have the script not pause?

    The SendKeys is good advice. In fact, that is the way I ended up doing it and it works.

    I have a "Master Script" and two sub scripts. the Master starts the first sub script. This sub script opens up the UI. Then the Master has a Pause Timer to wait a couple of seconds because I need to make sure that the UI opened. After the pause the Master Script executes the second sub. This one puts the UI Window in Focus (necessary because the send keys need to be sent to the right window) and executes the Send Keys. Sending Enter didn't work, but sending the Short-Cut (in my case Alt+P) did work.

    Not a very clean solution, but it works.

    Thanks again!

    B.