Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

referencing the prompt for automation

Status
Not open for further replies.

Ska47145

Technical User
Jun 11, 2014
2
US
I don't know if it is just so simple, that nobody has explained it in tutorial. But all I want to do is have Reflection, respond to it's own question. Let me explain..

So I've been tasked with printing files(about a thousand). There are two types of file, and they print to different printers. These are both simple enough to automate, however. Nowhere on my list does it say which file is which. At the time I go to print. Reflection tells me a serial/reference depending on the type (example)

are you sure you want to print (1827ba)?
or
are you sure you want to print (587hks)?

these are always the same (either/or).. I've searched high and low, and scoured the net.

All I want is:

If {prompt} = (1827ba)? Then
.transmit "printer1" & CR
Else
.transmit "printer2" & CR


but for the love of pete.. nobody has been able to answer this for me. What do I put in the place of {prompt}? how do I make it look at it's own question?
Or is there an easier or faster way to do this?

If you cannot tell, I'm not trained in programming. Just chip away at it til it works, I've automated many basic functions but again.. this escapes me.

I've attempted .waitforstring, I've attempted : "DIM prompt as string", but still how do I tell "prompt" that I'm referencing the question it's asking me?

I could just set it up for an input box and have some poor soul sit there entering 1, 2, 1 ,1 ,2,1,1,1,2 etc. based on what questions comes up, but it's got to be soooo simple. please help.
 
Hi,

In you programming language reference look for Active Printer or something like that.

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Well I know which printers i need to send to, but I have to tell it either/or based on what the prompt says, actually type in the printer name to send to. So if the prompt says one thing.. send it there, if it says the other.. send it to the other.

every tutorial/reference I find is discusses data the user inputs, instead of what the terminal is telling me. It's telling me which kind of file it is, but then i have to enter data 1 or data 2 to continue. I should be able to automate it, to enter the data based on the prompt.

I guess another way to ask is: what is the term for the prompt? .datareturn? .terminal? .Commandprompt?, how can i say "if you're asking this reflection, i want this, but if you ask that, i want that"?

like .waitforstring "______"? waits for that text to show up in the prompt, but I cannot do, if string = "_______"

that's all.. like if it says

Press ENTER to continue

can i have: If (term i'm trying to figure out) = "Press ENTER to continue" Then transmit CR ELSE transmit "whatever"?

or is the only way to move forward

.waitforstring "Press ENTER to continue"
.transmit CR

and enter a error handler to skip whatever is left over?


I don't know if i'm asking this right. but if it says "Press ENTER to continue" and is waiting for input, can you have VBA read that line and respond based on what it's asking? forget the printers..

Sorry if my questions aren't clear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top