Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

link99sbc (TechnicalUser) (OP)
23 Apr 09 23:00
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.
link99sbc (TechnicalUser) (OP)
23 Apr 09 23:11
oops
replace
Enter C:\Program Files\Attachmate\Macros\Session1.ebm
Should look like:
StartupScript=C:\Program Files\Attachmate\Macros\Session1.ebm

with

Enter C:\Program Files\Attachmate\Sessions\Session1.ebm
Should look like:
StartupScript=C:\Program files\Attachmate\Sessions\Session1.ebm  
link99sbc (TechnicalUser) (OP)
30 Apr 09 23:08
Never mind I had it right the first time.

Enter C:\Program Files\Attachmate\Macros\Session1.ebm
Should look like:
StartupScript=C:\Program \files\Attachmate\Macros\Session1.ebm
 

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close