Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-03-2015, 12:31 PM
Phen Phen is offline
Registered User
 
Join Date: Dec 2014
Posts: 10
Rearrange tabs

Hi everyone!
The problem I am trying to solve:
Sometimes I work with big number of routers and switches and maybe 1-2 connection to other VMs.
I want to re-arrange tabs (mainly because R10 is between R1 and R2).
Now, I know Python quite well, so it is not a problem for me to implement this logic.
However, I am not sure if there exists API call which will set index of the tab to what I want.
So does it exist?
If not, I would propose to implement either:
  • something like tab.setIndex(i) which would work as python list.insert(i, list.pop(j)) or
  • tab.swap(another_tab) which will swap two tabs or
  • crt.setTabs(ordered_list_of_tabs)
Reply With Quote
  #2  
Old 07-05-2015, 11:17 AM
bgagnon bgagnon is online now
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hello Phen,

What version of SecureCRT are you using?

Quote:
I want to re-arrange tabs (mainly because R10 is between R1 and R2).
What do you mean by the above statement?

Are you trying to change the order the sessions appear in the Connect dialog (or Session Manager)?

Or after you have connected the sessions in tabs?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 07-05-2015, 05:01 PM
Phen Phen is offline
Registered User
 
Join Date: Dec 2014
Posts: 10
Quote:
Originally Posted by bgagnon View Post
Hello Phen,

What version of SecureCRT are you using?



What do you mean by the above statement?

Are you trying to change the order the sessions appear in the Connect dialog (or Session Manager)?

Or after you have connected the sessions in tabs?
Hello.
I am using 7.3.0.
I am trying to reorder tabs after I connect to sessions.
The quoted statement means that I have tab titles R1, R2, ... R10, R11, ... and R10, R11, ... are after R1 but before R2.
Currently I am moving them manually, but I wanted to write a script and bind it to the button to do it automatically.
Reply With Quote
  #4  
Old 07-06-2015, 10:02 AM
bgagnon bgagnon is online now
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi Phen,

Thanks for the clarification.

One way to assure multiple sessions open in the desired order (in your scenario) is to set them to be ordered logically, instead of alphabetically. Then, when you open a folder of sessions, they should open in that expected order. This configuration option is found in the General category of SecureCRT's Global Options (Connect dialog sort order).

With respect to the original inquiry, with the current objects, methods and properties available, I think you could accomplish your objective via a script, if desired.

See the SecureCRT Help topic Scripting / Script Objects Reference. I think the GetTabCount() and GetTab() methods available to the Application Object along with the Index property available to the Tab Object are the ones you might need.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 07-07-2015, 08:34 AM
Phen Phen is offline
Registered User
 
Join Date: Dec 2014
Posts: 10
Hello.
I tried to change the index the way you proposed:
Code:
tab = crt.GetActiveTab()
tab.Index = 3
and I get the error
"Attribute Index of Tab objects is not writable"
which was expected.
Reply With Quote
  #6  
Old 07-07-2015, 11:29 AM
bgagnon bgagnon is online now
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi Phen,

Correct, it's a read-only property. I rethought this and I don't think you can accomplish with the current APIs. I was thinking of tab caption swapping.

I have added this thread to a feature request in our product enhancement database for the ability to reorder tabs through scripting. Should a future release of SecureCRT include this feature, notification will be posted here.

If you prefer direct email notification, contact support@vandyke.com and include "Feature Request - Forum Thread #12023" in the subject line.
__________________
Thanks,
--Brenda

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

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 11:35 AM.