Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 07-07-2016, 08:22 PM
gates2010 gates2010 is offline
Registered User
 
Join Date: Jun 2012
Posts: 18
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.
Reply With Quote
  #2  
Old 07-08-2016, 01:41 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,024
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:
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.
I don't understand the reference to windows task bar. Are you referring to the jump list associated with applications in the task bar in Windows 7 and later?

What version of SecureCRT are you using?

What OS is it installed on?


Quote:
Also, is there a way to rename all the tabs in a specific window at once?
The attachment illustrates the various ways tabs can be renamed. Some are only temporary (such as right-clicking a tab and renaming it). Some are permanent.

What is the problem you are trying to solve?
Attached Images
File Type: png Tab Rename - Explained.png (225.3 KB, 540 views)
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 07-08-2016, 05:03 PM
gates2010 gates2010 is offline
Registered User
 
Join Date: Jun 2012
Posts: 18
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.
Reply With Quote
  #4  
Old 07-08-2016, 05:15 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,024
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
Reply With Quote
  #5  
Old 07-08-2016, 05:20 PM
gates2010 gates2010 is offline
Registered User
 
Join Date: Jun 2012
Posts: 18
ok, thanks for the quick response on this.
Reply With Quote
  #6  
Old 07-08-2016, 05:31 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,024
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
Reply With Quote
  #7  
Old 07-08-2016, 07:03 PM
gates2010 gates2010 is offline
Registered User
 
Join Date: Jun 2012
Posts: 18
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 07:10 PM.
Reply With Quote
  #8  
Old 07-26-2017, 02:49 AM
g114112118s g114112118s is offline
Registered User
 
Join Date: Aug 2010
Posts: 24
Post

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.GetTabCount
Set objTab = crt.GetTab(nTabIndex) objTab.Activate If objTab.Session.Connected = True Then
crt.Screen.Send chr(13) crt.Screen.WaitForString vbcrlf strHostname = crt.Screen.ReadString("(", ">", "#") objTab.Caption = strHostname
End If
next End Sub
Reply With Quote
  #9  
Old 07-26-2017, 09:24 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,024
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 11:52 AM. Reason: Removed word for clarification
Reply With Quote
  #10  
Old 07-26-2017, 09:33 PM
g114112118s g114112118s is offline
Registered User
 
Join Date: Aug 2010
Posts: 24
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
Reply With Quote
  #11  
Old 07-27-2017, 12:05 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,024
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
Reply With Quote
  #12  
Old 07-27-2017, 08:38 PM
g114112118s g114112118s is offline
Registered User
 
Join Date: Aug 2010
Posts: 24
Hi, Brenda,

That solves the issue, Thank you very much for your time and support.

Regards,
Reply With Quote
  #13  
Old 09-11-2018, 04:34 PM
Maureen's Avatar
Maureen Maureen is offline
VanDyke Product Director
 
Join Date: Feb 2004
Location: Albuquerque, NM
Posts: 1,535
Quote:
Originally Posted by gates2010 View Post
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.
Support for setting tab and window bar captions independently has been added to a pre-beta version of SecureCRT. Please email me at Maureen.Jett@vandyke.com if you would like to try it.

Regards,
Maureen
Reply With Quote
Reply

Tags
multiple at once , tab title , window title


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 07:37 AM.