Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-18-2017, 12:22 AM
DeeZ DeeZ is offline
Registered User
 
Join Date: Jun 2014
Posts: 10
Get Description of saved session via script

Hello.
I have some useful info in saves session (see atttach).

I'd like to get this info into my script.
How can I get it? What property store this?
Attached Images
File Type: png Screenshot_2017-12-18_12-20-54.png (47.7 KB, 43 views)
Reply With Quote
  #2  
Old 12-18-2017, 09:10 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 472
Hi DeeZ,

Text entered in the Description field is stored in the session ini file in the Description field. You can access this data using something like:
Code:
# $language = "VBScript"
# $interface = "1.0"

Set objTab = crt.GetScriptTab
Set objConfig = objTab.Session.Config
strDescription = Join(objConfig.GetOption("Description"))

crt.Dialog.MessageBox(strDescription)
Does this help get you the functionality you're looking for?
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 12-18-2017, 08:30 PM
DeeZ DeeZ is offline
Registered User
 
Join Date: Jun 2014
Posts: 10
Quote:
Originally Posted by ekoranyi View Post
Does this help get you the functionality you're looking for?
Yes! Excelent. Thank you.

I use Python:
Code:
# $language = "Python"
# $interface = "1.0"
import SecureCRT

def main():
    ScriptTab = crt.GetScriptTab()
    config = ScriptTab.Session.Config
    Description = ''
    for line in config.GetOption("Description"):
        Description = Description + '\n' + line
    crt.Dialog.MessageBox(Description)

main()
Reply With Quote
  #4  
Old 12-19-2017, 08:09 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 472
Hi DeeZ,

I'm glad to hear you were able to get access to the data you needed.

Have a great rest of the day.
__________________
Thanks,
--Eric

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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 04:15 AM.