I am working in coded sequence workflow where i have to copy the data displayed on a grid and then paste it to an excel spreadsheet. For this I need to perform CTRL+c to copy and CTRL+v to paste.
var orderIds = uiAutomation.Attach(Descriptors.MyTool.MyWindow); orderIds.TypeInto(“myWindowsElement”, “my hotkey operation” );
I know TypeInto wont work this way to send hotkeys. Is there any other method to perform the same?
I see there is a KeyboardShortcut(“myWindowsElement” ,KeyboardShortcutOptions ) method present.
using WindowsInput;
using WindowsInput.Native;
var inputSimulator = new InputSimulator();
// CTRL+C
inputSimulator.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_C);
//CTRL+V
inputSimulator.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V);
This is something generic solution in C#, thanks for it.
Are there any methods available in UiPath that I could play around with?
I know to send a simple text is myScreen.TypeInto(“myelement”, “mytext”) is used. But how can I send CTRL+c or CTRL+v on an object.
I tried exploring myScreen.KeyboardShortcut(“myelement”, KeyboardShortcutOptions);
But unable to figure out further how to utilise this.