Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-24-2021, 02:58 PM
JerelH's Avatar
JerelH JerelH is offline
Registered User
 
Join Date: Jul 2017
Posts: 3
Error when running "Import Arbitrary Data From File to SecureCRT Sessions" script

I have recently upgraded to SecureCRT Version 9.0.1 (build 2451)
I am running it on macOS Catalina: 10.15.7 (19H524)
and when trying to run the:
"Import Arbitrary Data From File to SecureCRT Sessions"
script from the Script Examples post; I get the following error:
Code:
SyntaxError

Error: invalid syntax
File: /Volumes/GoogleDrive/My Drive/SecureCRT_Scripts/ImportArbitraryDataFromFileToSecureCRTSessions.py
Line: 443

    except Exception, objErr:
The corresponding portion of the script reads (line 443 is marked):
Code:
def OpenPathInDefaultApp(strFile):
    strPlatform = sys.platform
    crt.Session.SetStatusText("Platform: {0}".format(strPlatform))
    crt.Sleep(200)
    try:
        if sys.platform.startswith('darwin'):
            subprocess.call(('open', strFile))
        elif strPlatform == "win32":
            os.startfile(strFile)
        elif sys.platform.startswith('linux'):
            subprocess.call(('xdg-open', strFile))
        else:
            MsgBox("Unknown operating system:  " + os.name)
##Line 443->>##    except Exception, objErr: 
        MsgBox(
            "Failed to open " + strFile + " with the default app.\n\n"  +
            str(objErr).replace('\\\\', '\\').replace('u\'', '\''))
I am not much of a python coder and could use some help resolving this error
Reply With Quote
 

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 02:26 AM.