#1
|
||||
|
||||
![]()
Hello,I wanted to set a key map in script, but failed, will anyone can help me? Thank you!
Bellow is the option's screen shot, I'd like to set it in script: My Securecrt version is: Version 7.1.3 (build 378). The help file says: If the option is a multi-string (Z), an array of strings should be specified for the value. I get the property text from an ini file like below: Code:
--------------------------- Z:"Keymap v3"=00000001 C VK_C DISABLED --------------------------- Code:
crt.Session.Config.SetOption("Keymap v3", new Array("C VK_C DISABLED")); crt.Session.Config.SetOption("Keymap v3", "C VK_C DISABLED"); Code:
--------------------------- SecureCRT --------------------------- CRT Scripting Runtime error Error: The specified value is not valid for 'Keymap v3'. session.ini: Code:
Z:"Keymap v3"=00000001 C VK_C DISABLED Code:
# $language = "JScript" # $interface = "1.0" function alert(strContent, strTitle) { crt.dialog.MessageBox(strContent, strTitle); } function main() { alert(crt.Session.Config.GetOption("Keymap v3").toString()); // [object Object] alert(Object.prototype.toString.call(crt.Session.Config.GetOption("Keymap v3"))); // [object Object] alert(crt.Session.Config.GetOption("Keymap v3") instanceof Object); // False alert(crt.Session.Config.GetOption("Keymap v3") instanceof Array); // False var keys =[]; testObj=crt.Session.Config.GetOption("Keymap v3"); for(var i in testObj){ keys.push(i); } alert(keys.join("-")); // "" Empty string } Code:
# $language = "Python" # $interface = "1.0" obj=crt.Session.Config.GetOption("Keymap v3") crt.Dialog.MessageBox('\n'.join(obj)) // "" crt.Dialog.MessageBox(type(obj).__name__) // list Last edited by seesea; 10-11-2019 at 03:12 AM. |
Tags |
keymap , script , securecrt |
Thread Tools | |
Display Modes | Rate This Thread |
|
|