#1
|
|||
|
|||
Two scripting issues in 8.7.3 with Captions
I see two issues with Perl scripts with SecureCRT v8.7.3 on Windows 10, 2004.
Please bear with me, it looks simple on the surface, but there's complications that make it curious. I have two versions of SCRT installed on the PC. Old version is Ver. 8.5.3 (x64 build 1867) New version is Ver. 8.7.3 (x64 build 2279) I have been using Perl scripts happily with SecureCRT for many years. ISSUE 1 When I upgraded to 8.7.3, the command: Code:
$crt->window->{"caption"} = $hostname; Recap; on 8.7.3, the script runs with no error, and the tab text does not change. I see no error messages. It works fine in 8.5.3. My workaround is to keep using 8.5.3 Here's a script I use as a test. It fails to update the TAB caption on 8.7.3 and works the way I want with 8.5.3. Code:
#$language="perlscript" #$interface = "1.0" use Win32::OLE; Win32::OLE->Option(Warn => 3); my $hostname = "TEST"; $crt->window->{"caption"} = $hostname; exit(0); The observant folks will immediately notice that I used 'set window caption' and not 'set tab caption'. There's an important reason for that. In 8.5.3 (maybe earlier) the 'set tab caption' does not work for me. In 8.5.3, however, 'set window caption' DOES set the TAB caption perfectly fine. I assume that in 8.7.3, that 'feature'/behavior was 'fixed', because in 8.5.3, 'set window caption' will set both the tab and the window caption. I don't care about the window caption at all, so I use the command to set the tab caption. I was happy. BUT In fact, the command: Code:
$crt->tab->{"caption"} = $hostname; Code:
PerlScript Error: Error: Win32::OLE(0.1712) error 0x80020003: "Member not found" in METHOG/PROPERTYGET "" I assume that the syntax of the commands are correct, but there's not much Perl documentation for SCRT that I can find, so I've had to guess at a lot of stuff so That's my most likely error; in just guessing. Code:
$crt->window->{"caption"} = $hostname; Code:
$crt->tab->{"caption"} = $hostname; ![]() Thanks for reading. Baron. Please forgive and call out any possible typos. |
#2
|
|||
|
|||
Hi Baron,
The differences you are seeing are from this change: Changes in SecureCRT 8.7 (Beta 1) -- November 20, 2019 ------------------------------------------------------ New features:
For ISSUE 2, I'm not great at perl, but I think it needs to be a $tab object, not a $crt object since you are trying to specify the tab caption and not the window caption and they are now able to be specified independently. Code:
my $tab = $crt->GetScriptTab; $tab->{"caption"} = $hostname;
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Oh! Thank you so much! As soon as I can get a chance, I will try. Thanks for reading and responding.
|
#4
|
|||
|
|||
I can't get those to do anything. I am resorting to trial and error
![]() Code:
my $tab = $crt->GetScriptTab; # not working $tab->{'caption'} = $hostname; # not working $crt->tab->{$hostname}; # not working $crt->$tab{'caption'} = $hostname; # doesn't compile $crt->tab{'caption'} = $hostname; # doesn't compile $crt->tab->{'TEST'}; # not working $tab->caption{'TEST'}; # doesn't compile $tab->caption{$hostname}; # doesn't compile $tab->caption{'$hostname'}; # doesn't compile $tab->caption{"$hostname"}; # doesn't compile $crt->tab->caption{'TEST'}; # doesn't compile The SCRT help documentation doesn't show 'GetScriptTab' as a valid method. 'not working' means no error, but nothing happens. ![]() I liked it better when it was broken ![]() I'm still trying things. Thanks again! |
#5
|
|||
|
|||
Hi Baron,
I posted exactly what worked for me. See graphic below. GetScriptTab is a method available to the Application object. Description Returns the tab or tiled session window from which the script was started.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 Last edited by bgagnon; 11-03-2020 at 02:24 PM. Reason: Addressed GetScriptTab |
#6
|
|||
|
|||
Thank you so very much, bgagnon!
It works! I am happy. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|