Find Session1 or whatever your session names are, usually in C:\Program Files\Attachmate\Sessions\Session1.edp Right Click on it and choose Send to - then Desktop, which creates a shortcut on the desktop if you don't already have one. I drag the shortcut from the desktop to my windows tool bar so it's always handy. Next, Edit Session1.edp in the Sessions Folder. Right click and choose "open with" and choose "Macro Editor application". You may have to search for it.
After you open Session1.edp look for the StartupScript line under [Session] StartupScript=
Enter C:\Program Files\Attachmate\Macros\Session1.ebm Should look like: StartupScript=C:\Program Files\Attachmate\Macros\Session1.ebm 'or wherever your macros are 'This calls macro Session1.ebm
Save the file and close.
Create macro Session1 as you would any other macro. It has to be in the same path as the StartupScript. i.e. C:\Program Files\Attachmate\Macros\Session1.ebm
' Global variable declarations Global g_HostSettleTime% Global g_szPassword$
Sub Main() '-------------------------------------------------------------------------------- ' Get the main system object Dim Sessions As Object Dim System As Object Set System = CreateObject("EXTRA.System") ' Gets the system object If (System is Nothing) Then Msgbox "Could not create the EXTRA System object. Stopping macro playback." STOP End If Set Sessions = System.Sessions
If (Sessions is Nothing) Then Msgbox "Could not create the Sessions collection object. Stopping macro playback." STOP End If '-------------------------------------------------------------------------------- ' Set the default wait timeout value g_HostSettleTime = 1000 ' milliseconds
OldSystemTimeout& = System.TimeoutValue If (g_HostSettleTime > OldSystemTimeout) Then System.TimeoutValue = g_HostSettleTime End If
' Get the necessary Session Object Dim Sess0 As Object Set Sess0 = System.ActiveSession If (Sess0 is Nothing) Then Msgbox "Could not create the Session object. Stopping macro playback." STOP End If If Not Sess0.Visible Then Sess0.Visible = TRUE Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
' This section of code contains the recorded events
' All of the sendkeys should match however you navigate ' once the session is started. (i.e. navigating through ' startup screens. Sess0.Screen.Sendkeys("<Enter>") Sess0.Screen.WaitHostQuiet(g_HostSettleTime) Sess0.Screen.Sendkeys("<Pa1>") Sess0.Screen.WaitHostQuiet(g_HostSettleTime) Sess0.Screen.Sendkeys("8<Enter>") Sess0.Screen.WaitHostQuiet(g_HostSettleTime) Sess0.Screen.Sendkeys("2<Enter>") Sess0.Screen.WaitHostQuiet(g_HostSettleTime) pause 1 'Optional Use a password box if you if you have security issues. Sess0.Screen.Sendkeys("YourLogin Your Password<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime) Sess0.Screen.Sendkeys("myscreenname<Enter>") Sess0.Screen.WaitHostQuiet(g_HostSettleTime) Sendkeys "%FOSession2" 'THIS FIRES UP Session2 which calls the Session2 Macro "and so on" Sendkeys "{Enter}"
System.TimeoutValue = OldSystemTimeout End Sub
Each Session.edp needs to be edited "StartupScript=" to point to the Session.ebm Macro Use whatever your Session names are. Once you click on your shortcut to session1 all the other sessions will fire up one right after the other. I use 4 Sessions so each session calls the the next one. |
|