ActiveSession Property

Returns an object, the session that is currently visible.

Client support

   Newlook Smartclient only.

Version Support

Introduced in Version 11.1.

Sessions.ActiveSession = [session object]

Use

This property returns the session which is currently visible in the client.

Use the SetActiveSession Method to change the active session by session name at runtime.

ThisSession versus Sessions.ActiveSession

Sessions.ActiveSession returns the currently visible session. It should not be confused with ThisSession, which returns the currently executing session (the one in which the current script/macro/expression was invoked). This is important to note, because while these two properties will often return the same session, there will be times when they are different. One of those times is immediately after you have changed the active session in a script. Calling Sessions.SetActiveSession does not change the value of 'App' or 'ThisSession' (within the context of any script or macro). If you wish to change the active session and then execute logic in that session, you will need to invoke the logic from an event that is triggered in the active session. The other scenario where these properties would return different sessions is one where you are executing logic from a session that is running in the background. In other words 'Sessions.ThisSession' is not the currently visible session.

EXAMPLE

The following script checks if the currently visible session is the HelperSession and displays a message box if it is.

// Generate a confirmation message if "HelperSession" is the currently visible session in the client.

if (Sessions.ActiveSession.Name == "HelperSession")

{

App.MsgBox("You are running a Helper session.", "Session Confirmation.");

}

 

See Also

IsStartup Property

Session Object

Sessions Collection

Working with sessions

StartupSession Property

ThisSession Property

Add Method - Sessions

Remove Method - Sessions

SetActiveSession Method

Applies To

Sessions Collection


© 2004-2021 looksoftware. All rights reserved.