Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-21-2017, 07:24 AM
scrt_fool scrt_fool is offline
Registered User
 
Join Date: Jan 2013
Posts: 13
Question Custom mnu Menu-File: how to SEND multiple backspaces

Hi,

is there a way to send multiple backspaces in a custom menu file?

For backspace I am using:
\033[D
When I need some backspaces is there a possibility to send this n times.

Code:
MENUITEM "myMenu Item", "SEND", "Hello\033[D\033[D\033[D\033[D"
E.g.: for sending 4 times backspace: {\033[D 4}
Code:
MENUITEM "myMenu Item", "SEND", "Hello{\033[D 4}"
-> but like this it does not work

Thanks and best regards
scrt_fool
Reply With Quote
  #2  
Old 07-21-2017, 07:53 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi scrt_fool,

As you discovered, that syntax is not supported in a custom menu file.

What problem are you trying to solve?

Does sending the data for backspace have to be done via a menu option?

Why not just map a button or a key to send one backspace and then execute it as many times as needed? (I am assuming the data sent is different from what the keyboard backspace key sends.)

Or mapping one button/key to send two at a time, another button/key to send three at a time, etc.?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 07-26-2017, 02:43 AM
scrt_fool scrt_fool is offline
Registered User
 
Join Date: Jan 2013
Posts: 13
sorry made a little mistake

Hi Brenda,

sorry, I made a mistake here.
I don`t want to send BACKSPACE.
I want to send LEFT.
Means I want to put the cursor at a specific position where I want to write something.

And it works with: \033[D
But when I want to send LEFT Key n-times then I need to write this n-times in a row:
\033[D\033[D\033[D\033[D\033[D

And I like to know if there is a possibility to specify n

If possible in mnu Menu File. If not maybe in a script.

Thanks
Reply With Quote
  #4  
Old 07-26-2017, 08:37 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi scrt_fool,

What version of SecureCRT are you using?

On what platform/OS?

VBScript's SendKeys() method does allow for specifying the data be sent multiple times:

Quote:
You can use the SendKeys method to send a pattern of keystrokes that consists of a single keystroke pressed several times in a row. To do this, create a compound string argument that specifies the keystroke you want to repeat, followed by the number of times you want it repeated. You do this using a compound string argument of the form {keystroke number}. For example, to send the letter "x" ten times, you would send the string argument "{x 10}". Be sure to include a space between keystroke and number.
This method also has a built-in reference to be used for arrow keys {LEFT}.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 08-31-2017, 04:43 AM
scrt_fool scrt_fool is offline
Registered User
 
Join Date: Jan 2013
Posts: 13
Thumbs up

Hi Brenda,

thanks and sorry for late reply.
I am using version 6.7.5 on WIN7-64bit.
Soon on WIN10.

I tried your suggestion and it works.
So I am not using "SEND" in the Menu but "RUN"
And in the VBScript I am using send and sendkeys.

E.g.
Code:
crt.Screen.Send "xxxx  yyyy "
crt.Screen.sendkeys ("{LEFT 6}")
If there is no other possibility in menu (mnu) file itself I will do it like this, if I need a large count of "LEFT`s"

And if I need only some "LEFT`s" I use still "SEND" and the code "\033[D" for "LEFT" (like shown in my first example)

Thanks and best regards
scrt_fool
Reply With Quote
  #6  
Old 08-31-2017, 08:10 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi scrt_fool,

I am glad to hear of your success.

Please note the first version of SecureCRT with support for Windows 10 was v7.3.4. You can check your upgrade eligibility here.
__________________
Thanks,
--Brenda

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

Tags
menu , menuitem , mnu , send

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 12:48 AM.