Running a Macro Without Seeing Commands Executed
PASSPORT PC to Host, PASSPORT Web to Host
TN3270, TN5250, VT, SCO ANSI, Wyse 60
How can I have a macro run without the user seeing the commands being executed?
There are two known solutions, which both utilize the PASSPORT Object API as described below:
The Visible property of the Session object may be used to hide the PASSPORT window while the macro commands are being executed, then un-hide after all commands have finished executing.
Sample .ZAM macro:
Sub Main() Dim Sys, Sess Set Sys = CreateObject("PASSPORT.System") Set Sess = Sys.ActiveSession Set MyScreen = Sess.Screen Sess.Visible = False MyScreen.SendKeys "MyCommand<ENTER>" MyScreen.WaitHostQuiet(2000) MyScreen.SendKeys "MyUserID<ENTER>" MyScreen.WaitHostQuiet(2000) MyScreen.SendKeys "MyPassword<ENTER>" MyScreen.WaitHostQuiet(2000) MyScreen.SendKeys "3.4<ENTER>" MyScreen.WaitHostQuiet(2000) Sess.Visible = True End Sub
The ColorScheme property of the Session object may be used to temporarily set the text color equal to the background color while commands are executed, then set the colors back to default settings after all commands have finished executing. You must create a custom color scheme that sets the Unprotected Normal, Unprotected High, Protected Normal and Protected High categories to the same color as the Screen Background, then specify this color scheme file in the macro.
Sample .ZAM macro:
Sub Main() Dim Sys, Sess Set Sys = CreateObject("PASSPORT.System") Set Sess = Sys.ActiveSession Set MyScreen = Sess.Screen Sess.ColorScheme = "MyColorScheme" MyScreen.SendKeys "MyCommand<ENTER>" MyScreen.WaitHostQuiet(2000) MyScreen.SendKeys "MyUserID<ENTER>" MyScreen.WaitHostQuiet(2000) MyScreen.SendKeys "MyPassword<ENTER>" MyScreen.WaitHostQuiet(2000) MyScreen.SendKeys "3.4<ENTER>" MyScreen.WaitHostQuiet(2000) Sess.ColorScheme = "<default>" End Sub
run, macro, invisible, visible, colorscheme, command, executed, hidden