Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > General


Thread Tools Display Modes
Old 11-12-2019, 12:36 PM
VanDyke82nev VanDyke82nev is offline
Registered User
Join Date: Jul 2017
Posts: 17
Button code for duplicate string or character

Is there a shortcut in the code for a button to send something multiple times? Like say I wanted to send 30 dashes.

------------------------------ << 30 dashes

Can I put that in a button with a shortcut?

Something like:


That was just a wild guess.

I want to keep the button code short.

Alternatively, might there be a way to use variables with the buttons? Like:


Reply With Quote
Old 11-12-2019, 04:46 PM
ashiosee ashiosee is offline
Registered User
Join Date: Oct 2019
Posts: 24
SecureCRT doesn't provide any native SEND_STRING repeat functionality.

However, you can achieve expanded functionality through scripting. Consider that you could map a button to run a script (instead of sending a string). The arguments to the script could be something like: char_sequence repeat_count

Where char_sequence represents what you want to send, and repeat_count represents the number of times you want it repeatedly sent.

Here's an example of such a script:
# $language = "Python"
# $interface = "1.0"

def main():
    # Check to make sure we have a char_sequence arg:
    if crt.Arguments.Count > 0:
        strStringSequence = crt.Arguments.GetArg(0)
            "Script argument expected: char_sequence\r\n" +
            "\r\n" +
            "This script expects two arguments: char_sequence repeat_count")
    # Check to make sure we have a repeat_count arg:
    if crt.Arguments.Count > 1:
            nRepeatCount = int(crt.Arguments.GetArg(1))
        except Exception as objException:
                "Arg Error: Expected integer value." +
                "\r\n" +
    # If we get to this point, we can move forward with sending
    # the char_sequence repeat_count times
    for nIndex in range(0, nRepeatCount):
Would something like this meet your needs?

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote
Old 11-12-2019, 05:16 PM
VanDyke82nev VanDyke82nev is offline
Registered User
Join Date: Jul 2017
Posts: 17
Thank you very much Allen!

I guess can stop looking for it for the button code, and if need be, go the script route.

I greatly appreciate your reply. Just another reason to be a fan of SecureCRT.
Reply With Quote


Thread Tools
Display Modes

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 11:49 PM.