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!

Need script for printing "print screens" from remote sys.

Status
Not open for further replies.

Gtech62

Technical User
Apr 28, 2004
2
US
Need to print page of "print screens" (text only), from scroll buffer as they are recieved from remote system.(direct connection) rather than waiting until buffer fills with multiple "pages".
Remote system previously sent data to line printer and user would send display then form feed to get page.
Any help would be greatly appreciated.
 
Is there a text string, such as a prompt, that indicates that the end of the current page has been reached? If so, you could use the when target command to call a procedure that issues the proper command to send the current screen to the printer. A basic script would look something like this:

proc main
when target 0 "string" call print_screen
while 1
yield
endwhile
endproc

proc print_screen
sendkey ALT 'L'
endproc

where the value "string" is replaced by the string that indicates the end of the current screen has been reached.

You might also need to add a pause 1 or pause 2 command to the beginning of the print_screen procedure in case the complete screen has not been displayed when that procedure is called.


aspect@aspectscripting.com
 
Thanks Knob for the fast response.
There is no common string to indicate end of display. However, there is a time group sent at start of page in the format "hh:mm:ss". Can wildcards, or something, be used to capture this? Then I can provide a delay for page to be received?

In the mean time, using your structure, here is what I have tried. (Retyped from memory at home. Hope I get it right)

Proc main
While 1
Printcapture on
if $rxcount>0
call prntpg
endif
yield
endwhile
endproc
Proc prntpg
pause 5
printcapture off
termreset
endproc

I'm sure this can be tweaked to be more efficient.
This works, but crudely. Remote system user will just have to send page prints slowly so that another screen isn't received before termrest.

Thanks in advance for anymore advice, tweaks, or ideas.
 
If there is nothing that the script can key off to indicate the new page has arrived, then you could use the waitquiet command to have the script pause until no data had been received for a specified amount of time. For example:

waitquiet 15 FOREVER

would not finish executing until no data had been received from the remote system for 15 seconds. You could modify my original script to look something like this (untested at the moment):

proc main
while 1
waitquiet 15 FOREVER
sendkey ALT 'L'
endwhile
endproc

If you are looking for a non-automated solution, then you could just create a script with the sendkey ALT 'L' command, assign it to a metakey, and have your user press that before sending the command to get the next key (or include that command in the script so they are only pressing one key to print the screen and get the next screen).


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top