RPA- UiPath, Regarding Special Keystrokes
Asked Answered
L

3

5

How to send the keystrokes such as Alt +E+A+B, tried to send the keys using type into while working with, Alt the button is not getting released after the process is closed. Also tried to send Alt+E but not able to send the rest of the Key strokes, is there any way to send all the key strokes at a time.

Any suggestion will helpful.

Latoyalatoye answered 6/11, 2018 at 11:5 Comment(1)
I think this link may be useful: how-to-insert-combination-keysHandrail
H
4

You can use the Send Hotkey activity to send hotkeys to an application:

Send hotkey

Hedvig answered 12/11, 2018 at 11:45 Comment(0)
S
10

You have a few options depending on how you want to pass along the special keys. As referenced by @Sebax in the Question's comments and @Mads T's answer I thought it would be good to go into more details.

When using Type Into activity, you have three methods depending on your needs

  1. Default Slowest of the three methods, using the hardware driver. It does NOT automatically erase pre-existing text nor does it work in the background, but supports special key strings (e.g. [k(enter)])
  2. SendWindowMessages It does NOT automatically erase pre-existing text but does work in the background while supporting special key strings (e.g. [k(enter)])
  3. SimulateType is the fastest of the three methods. It automatically erases pre-existing text and works in the background but does not support special key strings (e.g. [k(enter)]), in this case, you'll want to pair it with the Send Hotkey activity.

Special Key Strings

I've seen mention of k, d, and u in the UiPath Forums here and there, but have not seen official documentation that explains the modifiers or lists out the available special characters asides from looking at the Send Hotkey dropdown list.

  • k: Synthesize a key down (press) followed by a key up (release) for the specified key.
  • d: Synthesize a key down (press and hold) event for the specified key.
  • u: Synthesize a key up (release) event for the specified key.

Special Key examples

  1. "Hello[k(enter)" will type out "Hello" followed by a carriage return.
  2. "[d(alt)]efun[u(alt)]Hello[k(enter)k(esc)]" would
    1. Press down and hold the Alt key
    2. Press the keys e, f, u, and n
    3. Release the Alt Key
    4. Type the characters Hello
    5. Press the Enter key
    6. Press the Esc key

Send Hotkey The send hotkey is pretty straightforward. Indicate the key(s) you want to send and if needed check the key modifiers (Alt, Ctrl, Shift, Win). If the key you are sending is a special key (e.g. Enter), then you'll also want to enable the SpecialKey property of the activity.

Send Hotkey can use the Default or SendWindowMessages inputs.

Send Hotkey

References:

Simoniac answered 6/1, 2019 at 11:6 Comment(4)
Thanks for the solution, having one more doubt in a citrix environment i need to traverse through few text fields to enter a value at a certain text field, so in this situation if my control is at the first field and i want to enter value at the Tenth field then, I am using a Type into and sending "[k(tab)][k(tab)][k(tab)][k(tab)][k(tab)][k(tab)][k(tab)][k(tab)][k(tab)][k(tab)]". Is there any solution for sending multiple Tabs. Any suggestion will be helpful.Latoyalatoye
@Latoyalatoye - Glad the answer helped you out. It would be appreciated and helpful to others if you marked the answer as accepted.Simoniac
@Latoyalatoye - You could do a few things such as send the keys in a loop, or use one of the string functions to build a string of tabs for you. I'd suggest opening a new question for your issue if you need ideas beyond that.Simoniac
Its maybe poking out, but isn't there any security issue with that ? I mean it would be able to do simple command injection (start a cmd, delete files, etc, quite easly), and might be faulty for some string (even if it's unlikely).Venal
H
4

You can use the Send Hotkey activity to send hotkeys to an application:

Send hotkey

Hedvig answered 12/11, 2018 at 11:45 Comment(0)
A
0

You could always do a 'Type Into' method. Then just have something like the below:

"[d(ctrl)]g[u(ctrl)]" + pasteLocation + "[k(enter)]" + "[d(ctrl)]v[u(ctrl)]" +  "[d(ctrl)]s[u(ctrl)]"

All the above does is in Excel; goes to the Cell Variable and pastes in then Saves

Artemisia answered 11/3, 2020 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.