dbTalk Databases Forums  

Tricky Sendkeys() problem

comp.databases.paradox comp.databases.paradox


Discuss Tricky Sendkeys() problem in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Moseley
 
Posts: n/a

Default Tricky Sendkeys() problem - 02-20-2008 , 08: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 (shift-insert)
sleep(3000) ; let it do its thing

;-----

Reply With Quote
  #2  
Old   
OzPaul
 
Posts: n/a

Default Re: Tricky Sendkeys() problem - 02-26-2008 , 05:03 PM






Nice of you to share this Jim. Never ceases to impress me what one can
do with Paradox! Regards Paul.



On Feb 21, 12:19*pm, "Jim Moseley" <jm... (AT) mapson (DOT) attglobal.net> wrote:
Quote:
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 (shift-insert)
sleep(3000) *; let it do its thing

;-----


Reply With Quote
  #3  
Old   
OzPaul
 
Posts: n/a

Default Re: Tricky Sendkeys() problem - 02-26-2008 , 05:03 PM



Nice of you to share this Jim. Never ceases to impress me what one can
do with Paradox! Regards Paul.



On Feb 21, 12:19*pm, "Jim Moseley" <jm... (AT) mapson (DOT) attglobal.net> wrote:
Quote:
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 (shift-insert)
sleep(3000) *; let it do its thing

;-----


Reply With Quote
  #4  
Old   
OzPaul
 
Posts: n/a

Default Re: Tricky Sendkeys() problem - 02-26-2008 , 05:03 PM



Nice of you to share this Jim. Never ceases to impress me what one can
do with Paradox! Regards Paul.



On Feb 21, 12:19*pm, "Jim Moseley" <jm... (AT) mapson (DOT) attglobal.net> wrote:
Quote:
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 (shift-insert)
sleep(3000) *; let it do its thing

;-----


Reply With Quote
  #5  
Old   
OzPaul
 
Posts: n/a

Default Re: Tricky Sendkeys() problem - 02-26-2008 , 05:03 PM



Nice of you to share this Jim. Never ceases to impress me what one can
do with Paradox! Regards Paul.



On Feb 21, 12:19*pm, "Jim Moseley" <jm... (AT) mapson (DOT) attglobal.net> wrote:
Quote:
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 (shift-insert)
sleep(3000) *; let it do its thing

;-----


Reply With Quote
  #6  
Old   
OzPaul
 
Posts: n/a

Default Re: Tricky Sendkeys() problem - 02-26-2008 , 05:03 PM



Nice of you to share this Jim. Never ceases to impress me what one can
do with Paradox! Regards Paul.



On Feb 21, 12:19*pm, "Jim Moseley" <jm... (AT) mapson (DOT) attglobal.net> wrote:
Quote:
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 (shift-insert)
sleep(3000) *; let it do its thing

;-----


Reply With Quote
  #7  
Old   
OzPaul
 
Posts: n/a

Default Re: Tricky Sendkeys() problem - 02-26-2008 , 05:03 PM



Nice of you to share this Jim. Never ceases to impress me what one can
do with Paradox! Regards Paul.



On Feb 21, 12:19*pm, "Jim Moseley" <jm... (AT) mapson (DOT) attglobal.net> wrote:
Quote:
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 (shift-insert)
sleep(3000) *; let it do its thing

;-----


Reply With Quote
  #8  
Old   
OzPaul
 
Posts: n/a

Default Re: Tricky Sendkeys() problem - 02-26-2008 , 05:03 PM



Nice of you to share this Jim. Never ceases to impress me what one can
do with Paradox! Regards Paul.



On Feb 21, 12:19*pm, "Jim Moseley" <jm... (AT) mapson (DOT) attglobal.net> wrote:
Quote:
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 (shift-insert)
sleep(3000) *; let it do its thing

;-----


Reply With Quote
  #9  
Old   
Méta-MCI \(MVP\)
 
Posts: n/a

Default Re: Tricky Sendkeys() problem - 02-26-2008 , 05:56 PM



Hi!

Quote:
We needed to automate a PDF printer.
Use PDFcreator. This soft is free, priceless, open-source. AND, it can
be completely automated.

@-salutations

Michel Claveau







Reply With Quote
  #10  
Old   
Méta-MCI \(MVP\)
 
Posts: n/a

Default Re: Tricky Sendkeys() problem - 02-26-2008 , 05:56 PM



Hi!

Quote:
We needed to automate a PDF printer.
Use PDFcreator. This soft is free, priceless, open-source. AND, it can
be completely automated.

@-salutations

Michel Claveau







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.