This
example script shows how to utilize the "Local Shell" capability of SecureCRT to launch a local 'ping' command for any of the following (in order of precedence):
- currently in clipboard, or
- currently selected in the terminal window (if the clipboard is empty), or
- specified by the individual when prompted (if neither the clipboard nor the selection matches the pattern of a valid host name or IP address).
Download the example script here:PingHostFromClipboardOrSelection(LocalShell).py.txt
Note: This script requires a version of SecureCRT that supports the Local Shell protocol and will only work on an OS that supports Local Shell connectivity (e.g.: Linux, macOS, and Windows 10 Version 1809 and newer)
Code:
# Last Modified:
# 04 Aug, 2020
# - If a "Ping" tab already exists, activate and use
# that tab instead of opening a new tab.
# - If a tab already exists that was connected with
# the saved session named with the value of the
# strLocalShellSessName variable, activate and use
# that tab instead of opening a new tab.
#
# 30 Jul, 2020
# - Initial revision
--Jake