Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Paradox > Tricky Sendkeys...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 1332 of 1389
Post > Topic >>

Tricky Sendkeys() problem

by "Jim Moseley" <jmose@[EMAIL PROTECTED] > Feb 20, 2008 at 09:19 PM

Greetings, all.

I just ran across a problem that took me a while to solve, and thought I'd
share it.  

We needed to automate a PDF printer.  Using SendKeys() almost worked. 
Unfortunately,
the developer was tricky and put in a variable number of fields, so we
couldn't
just tab a certain number of times.  

I noticed that only 1 field was enterable & contained text - all the
others
were buttons or checkboxes.  So, using cut/paste, I was able to tell when
I was on the correct field to type in my file name.

HTH,
Jim Moseley

;---------

var tempStr, pdfPrefixCur string endVar

tempStr = ""
if not tempStr.writeToClipBoard() then   ; clear the clipboard
   errorShow("Write blank to Clipboard")
   return
endif
loopI = 0
while true
   sendkeys("{delay 50}{tab}^{insert}",true)	; tab & copy (ctrl-insert)
   if not tempStr.readFromClipboard() then
      errorShow("Read value from Clipboard")
      return
   endif
   if tempStr <> "" then   ; something returned - success!
      quitloop
   endif
   loopI = loopI + 1
   if loopI > 100 then
      quitloop
   endif
endWhile
if loopI > 100 then
   return
endif
if not pdfPrefixCur.writeToClipboard() then
   errorShow("Write value to clipboard")
endif
sendkeys("{delay 100}+{insert}{enter}",true)	; paste (****ft-insert)
sleep(3000)  ; let it do its thing

;-----
 




 6 Posts in Topic:
Tricky Sendkeys() problem
"Jim Moseley" &  2008-02-20 21:19:01 
Re: Tricky Sendkeys() problem
OzPaul <pfweston@[EMAI  2008-02-26 15:03:15 
Re: Tricky Sendkeys() problem
"Méta-MCI \(MVP\)&qu  2008-02-27 00:56:33 
Re: Tricky Sendkeys() problem
Mark Bannister <markRe  2008-02-27 09:47:48 
Re: Tricky Sendkeys() problem
Tom Krieg <user@[EMAIL  2008-02-28 10:57:07 
Re: Tricky Sendkeys() problem
OzPaul <pfweston@[EMAI  2008-03-02 16:21:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 0:36:04 CDT 2008.