View Single Post
  #1  
Old 08-03-2020, 01:08 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,034
Post Example: Ping Host from Selection/Clipboard Using Local Shell Connection

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):
  1. currently in clipboard, or
  2. currently selected in the terminal window (if the clipboard is empty), or
  3. 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
Attached Files
File Type: txt PingHostFromClipboardOrSelection(LocalShell).py.txt (7.1 KB, 113 views)
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support

Last edited by jdev; 08-04-2020 at 10:26 AM.