Scripting

  • 1.  I avoid using the VBScript SendKeys method wheneve

    Posted 12-02-2011 08:56
    I avoid using the VBScript SendKeys method whenever possible, but sometimes it is the only solution. I have a situation where I am using it to invoke the Accept button (I cannot use the BOI InvokeButton method since this script has to run on a MAS 200 Client in a button script where BOI is not available). The SendKeys method works flawlessly, but only about 50% of the time. It is a simple script and I've traced it to KNOW that the statement is being executed, but the Accept button sometimes doesn't invoke. Idea?


  • 2.  RE: I avoid using the VBScript SendKeys method wheneve

    Posted 12-13-2011 11:26
    I've often had to put in a sleep before invoking a sendkeys to give the system time to catch up to the keystrokes, and yes unfortunately it is often our only option :(


  • 3.  RE: I avoid using the VBScript SendKeys method wheneve

    Posted 12-13-2011 11:46
    Thanks Barbara, but the Sleep method isn't available in the environment of a button script. I tried a spin loop, but that didn't work either. I'm thinking the days of .sendkeys are over. At least for MAS 200.


  • 4.  RE: I avoid using the VBScript SendKeys method wheneve

    Posted 12-13-2011 12:17
    I call a script from a script or something like that, it's been a little while since I've done it. It's not available in the script on the button itself, but it will be available to the called script (I shell a vbs script if I recall correctly and do the processing in there). It's hokey but it works.


  • 5.  RE: I avoid using the VBScript SendKeys method wheneve

    Posted 12-13-2011 12:22
    That's my experience also, but my issue does't work any better in a called script using Sleep.


  • 6.  RE: I avoid using the VBScript SendKeys method wheneve

    Posted 12-13-2011 12:24
    weird, I've always gotten something like this to work: wscript.sleep(1000) Sorry I wish I had a solution for you.


  • 7.  RE: I avoid using the VBScript SendKeys method wheneve

    Posted 03-01-2012 13:59
    Did you ever get this resolved?


  • 8.  RE: I avoid using the VBScript SendKeys method wheneve

    Posted 04-27-2012 15:15
    I solved the problem by seperating the function into two buttons. One runs on the server and the other runs on the client. This actually turned out to be a boon for the flexibility of this particular application. It is for printing lables to a locally attached thermal printer. Seperating the buttons allow user's that don't have a thermal printer to queue labels that can be printed by the workstation that does.