View Single Post
  #2  
Old 01-09-2018, 05:34 PM
berdmann berdmann is offline
VanDyke Technical Support
 
Join Date: Aug 2017
Posts: 441
There is not currently any scripting API for managing tab groups nor moving tabs from one tab group to another.

I've added a feature request for you.

Depending on how complex you need things to be, you can effectively get new sessions opened in a tab group using this method:
  1. Connect to all sessions you desire to exist in left-most tab group first.

  2. Connect to the first session of your new tab group. After connection is successful, use the following statement to send the active tab (the most recent connected) to a new tab group:
    crt.Screen.SendSpecial("MENU_TAB_SEND_TO_NEW_TAB_GROUP")

  3. Any ConnectInTab calls you make from here on will open tabs in the new tab group.

Here's an example:
Code:
# $language = "VBScript"
# $interface = "1.0"

crt.Session.Connect("/S ""Session 1""")
crt.Sleep(1000)
crt.Session.ConnectInTab("/S ""Session 2""")
crt.Sleep(1200)
crt.Session.ConnectInTab("/S ""Session 3""")
crt.Sleep(1000)

' Connect to first session desired for new tab group:
crt.Session.ConnectInTab("/S ""Session 4""")
crt.Sleep(1500)
' Send that tab to a new group
crt.Screen.SendSpecial("MENU_TAB_SEND_TO_NEW_TAB_GROUP")
crt.Sleep(1200)

' From here on out, any new connections in tabs will appear
' in the new tab group:
crt.Session.ConnectInTab("/S ""Session 5""")
crt.Sleep(1200)
crt.Session.ConnectInTab("/S ""Session 6""")
crt.Sleep(1200)

' Activate all the existing tabs one by one, and
' rename them:
For i = 1 to crt.GetTabCount
    crt.GetTab(i).Activate
    crt.GetTab(i).Caption = "Tab " & i
    crt.Sleep(500)
Next
__________________
Thanks,
--Brittney

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by jdev; 01-09-2018 at 05:43 PM.
Reply With Quote