AutoHotkey Community

It is currently May 27th, 2012, 12:45 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: March 29th, 2010, 6:59 pm 
Offline

Joined: April 28th, 2007, 4:06 pm
Posts: 85
Thanks for the idea Sinkfaze, but no such luck.

Here is what I have learned thusfar:

The barcode scanner is putting the ID into the edit field of the GUI correctly

The variable %barcode% contains the correct information, as I can see when I invoke the {shift}+ portion of the script to resend it.

It happens generally when the script has not been used for a few hours if it happens at all, although not necessarily when it is run for the first time in a few hours (meaning I can leave the script running but not use it for that time, and then still get the error)

When the error occurs, it does not shift the entire variable. It leaves the first digit and the last three characters untouched, and shifts those in between

So unless I am missing something, the issue has to be either the controlsend function, or there is something wrong with the program itself. Since I have not encountered this problem without using the script, nor has anyone else who uses the program in question, that leaves the function as the culprit, unless I am completely mistaken.

Here is the code as it has been modified, just in case anyone wants to take another crack at it or has any further ideas, but, otherwise, this may just be an issue I am going to have to live with.

Thank you all again for all of your help. It is truly appreciated.

Code:
#SingleInstance force
SetTitleMatchMode, 2

IfWinNotExist, SAI Desktop Vault
{
   MsgBox, Please sign into the Desktop Client and then reload this program.
   ExitApp
}
Else


Gui, Add, Edit, x26 y40 w100 h20 vBarcode,
Gui, Add, Button, x26 y70 w100 h30 default, OK
Gui, Add, Text, x36 y10 w70 h20 , Scan Barcode
Gui, Show, x131 y91 h112 w164, Barcode
Return

Guiclose:
exitapp

ButtonOK:

SendEvent, {Blind}{Shift Up}
Gui, submit


IfWinExist, - DocLanding Image Viewer
{
   WinClose
}
SendEvent, {Blind}{Shift Up}
ControlSend, WindowsForms10.EDIT.app.0.2004eee1, % "{Blind}{Shift Up}" NumOnly(Barcode) "{Enter}", SAI Desktop Vault
WinWait, - DocLanding Image Viewer
WinMove, - DocLanding Image Viewer,, 0, 0, 597, 737
WinActivate, - EXTRA! X-treme, , LT2

+NumpadAdd::
SendInput, % NumOnly(Barcode) "{NumpadEnter}{space}"
WinClose, - DocLanding Image Viewer
Reload
Return

+F12::
SendEvent, {Blind}{Shift Up}
Reload

NumOnly(var) {
  chars:=")!@#$%^&*("
  Loop, parse, chars
    StringReplace, var, var, % A_LoopField, % A_Index-1, All
  return var
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2010, 4:23 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
This is the quickest way to send text, and i'm pretty sure it can't be "intercepted" by any keystrokes...
Code:
Clipboard := Barcode
ControlFocus, WindowsForms10.EDIT.app.0.2004eee1
SendInput ^v
:?:


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: chaosad, jrav, MSN [Bot] and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group