#1
|
|||
|
|||
How to rename window title with multiple tabs
Hi,
I am trying to figure out how to set a window title (similar to the rename option available for the tab), i want to be able to set a name manually instead of renaming all the tabs in that window to the name i want to see on the windows task bar. Also, is there a way to rename all the tabs in a specific window at once? Thank you in advance. |
#2
|
|||
|
|||
Hi gates2010,
Presently, the SecureCRT application window caption is tied to the current, active tab caption. I have added this thread to a feature request in our product enhancement database for the ability to set window and tab captions independently via scripting. Should a future release of SecureCRT include this feature, notification will be posted here. If you prefer direct email notification, send an email to support@vandyke.com and include "Feature Request - Forum Thread #12401" in the subject line or use this form from the support page of our website. Quote:
What version of SecureCRT are you using? What OS is it installed on? Quote:
What is the problem you are trying to solve?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Thanks for the reply.
W.r.t to the windows task bar, I am referring to the name that shows up for the application ex: ![]() The window title would show up here.. The problem with renaming tabs, I have 8 securecrt windows with 4 tabs each connected to the same server, each window is for a specific function, so if i am able to rename the window, it would show up on the windows taskbar and i can immediately go to it when i need to. Right now i am renaming all the 4 tabs inside the window with the name i want, so no matter which tab is active i get to see that name in the taskbar. Please let me know if you want me to clarify further. Windows 7 Pro edition 64-bit SecureCRT Version 7.3.6 (x64 build 963) Thanks. |
#4
|
|||
|
|||
Hi gates2010,
Thanks for clarifying. The feature request is the only option I can think of at this time.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
ok, thanks for the quick response on this.
|
#6
|
|||
|
|||
Hi gates2010,
You asked in a prior post for an easier way to change the tab captions. I imagine you are presently doing so manually which could be tedious under the circumstances described. ![]() You could use a script to help make that task simpler: Code:
For nIndex = 1 To crt.GetTabCount() Set objTab = crt.GetTab(nIndex) objTab.Caption = "MyNewTabCaption" Next
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#7
|
|||
|
|||
Thanks, this helps for now.
Code:
title=crt.Dialog.Prompt("Enter tab title") For nIndex = 1 To crt.GetTabCount() Set objTab = crt.GetTab(nIndex) objTab.Caption = title Next Last edited by gates2010; 07-08-2016 at 06:10 PM. |
#8
|
|||
|
|||
![]()
I also need same help on similar case. i am trying to assign caption dynamically based on prompt. Problem with my code is that only one of the prompt picked by the scripts and replicates on all tab. version is 6.7.3
Code:
Dim nTabIndex For nTabIndex = 1 To crt.GetTabCountSet objTab = crt.GetTab(nTabIndex) objTab.Activate If objTab.Session.Connected = True Thennext End Subcrt.Screen.Send chr(13) crt.Screen.WaitForString vbcrlf strHostname = crt.Screen.ReadString("(", ">", "#") objTab.Caption = strHostnameEnd If |
#9
|
|||
|
|||
Hi g114112118s,
Please see the VBScripting Manual here. It includes an example on detecting a prompt. Code:
Do ' Attempt to detect the command prompt heuristically... Do bCursorMoved = crt.Screen.WaitForCursor(1) Loop Until bCursorMoved = False ' Once the cursor has stopped moving for about a second, we'll ' assume it's safe to start interacting with the remote system. ' Get the shell prompt so that we can know what to look for when ' determining if the command is completed. Won't work if the prompt ' is dynamic (e.g., changes according to current working folder, etc.) nRow = crt.Screen.CurrentRow strPrompt = crt.screen.Get(nRow, _ 0, _ nRow, _ crt.Screen.CurrentColumn - 1) ' Loop until we actually see a line of text appear (the ' timeout for WaitForCursor above might not be enough ' for slower-responding hosts). strPrompt = Trim(strPrompt) If strPrompt <> "" Then Exit Do Loop
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 Last edited by bgagnon; 07-27-2017 at 10:52 AM. Reason: Removed word for clarification |
#10
|
|||
|
|||
Thank you, I tried following code but still only initial tab changes has per the correct prompt and later also all other open tab changes to the same name. OS Win7; CRT Version 6.7.3 (x64 build 292).
Code:
Existing tabname Expected tabname 1.1.1.1 HostnameA 2.2.2.2 HostnameB 3.3.3.3 HostnameC New tabname after the script Expected tabname HostnameB HostnameA HostnameB HostnameB HostnameB HostnameC Code:
# $language = "VBScript" # $interface = "1.0" Sub Main Dim nTabIndex For nTabIndex = 1 To crt.GetTabCount Set objTab = crt.GetTab(nTabIndex) objTab.Activate Do ' Attempt to detect the command prompt heuristically... Do bCursorMoved = crt.Screen.WaitForCursor(1) Loop Until bCursorMoved = False ' Once the cursor has stopped moving for about a second, we'll ' assume it's safe to start interacting with the remote system. ' Get the shell prompt so that we can know what to look for when ' determining if the command is completed. Won't work if the prompt ' is dynamic (e.g., changes according to current working folder, etc.) nRow = crt.Screen.CurrentRow strPrompt = crt.screen.Get(nRow, _ 0, _ nRow, _ crt.Screen.CurrentColumn - 1) ' Loop until we actually see a line of text appear (the ' timeout for WaitForCursor above might not be enough ' for slower-responding hosts). strPrompt = Trim(strPrompt) objTab.Caption = strPrompt If strPrompt <> "" Then Exit Do Loop next End Sub |
#11
|
|||
|
|||
Hi g114112118s,
The code added to detect the prompt was not changed to be tab-specific. You need to use objTab as the object, not crt: Code:
nRow = objTab.Screen.CurrentRow strPrompt = objTab.screen.Get(nRow, _ 0, _ nRow, _ crt.Screen.CurrentColumn - 1)
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#12
|
|||
|
|||
Hi, Brenda,
That solves the issue, Thank you very much for your time and support. Regards, |
#13
|
||||
|
||||
Quote:
Regards, Maureen |
![]() |
Tags |
multiple at once , tab title , window title |
Thread Tools | |
Display Modes | |
|
|