|
#1
|
|||
|
|||
Caption of active tab
Hello,
Since I upgraded to latest version of SecureCRT (9.0.1), the caption of the active tab is not changed any more by my script. I open a ssh session (File->Connect in tab), and then I run a VBS script. When the following line is executed Code:
crt.window.Caption = hostname With my new SecureCRT version, the caption of SecureCRT windows is changed with the content of the 'hostname' varaible (and the caption of the current tab is the propmt of the ssh session). I tried several things but I do not manage to change the caption of the active tab. Any idea ? Thank you! Below an extract of the script: Code:
# $language = "VBScript" # $interface = "1.0" Sub main crt.Screen.Synchronous = True ... hostname = ...... ... crt.window.Caption = hostname crt.Screen.Synchronous = False End Sub Last edited by cboyack; 05-13-2021 at 07:08 AM. Reason: Please use [CODE] and [/CODE] tags to denote areas of code |
#2
|
|||
|
|||
Hi fabb,
If you would be so kind as to take a look at the Scripting topic in SecureCRT's Help Window, you can see that there are both Tab and Window objects. Per the information in the Help, the crt.Window.Caption object returns or sets the title or caption of SecureCRT's application window. The tab.Caption object returns or sets the caption of the specified tab object. What happens if you start using the Tab-based object in your script instead of the Window-based object?
__________________
Thanks, --Cameron VanDyke Software Technical Support support@vandyke.com (505) 332-5730 Last edited by cboyack; 05-13-2021 at 09:50 AM. Reason: Clarity |
#3
|
|||
|
|||
Thanks!
I tried Code:
tab.Caption = hostname Quote:
Code:
crt.tab.Caption = hostname Code:
set tab.Caption = hostname |
#4
|
|||
|
|||
Hi again fabb,
I apologize for not sharing with you a working example. My bad. Here's an example of how to get at the tab object: Code:
Set objTab = crt.GetScriptTab objTab.Caption = hostname
__________________
Thanks, --Cameron VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
It works fine with your new code, thanks for your support !
|
#6
|
|||
|
|||
Excellent! I'm glad that you were able to get things working.
__________________
Thanks, --Cameron VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Tags |
caption , tab , window |
Thread Tools | |
Display Modes | Rate This Thread |
|
|