How to perform a Control+C and a Control+V?

cesario678

Client
Регистрация
10.03.2022
Сообщения
179
Благодарностей
13
Баллы
18
I would like to perform a Control+C on a variable and then do a Control+V to paste everything at once. I have a very large article, over 50,000 characters, and if I insert it using the "get" method, it pastes slowly. Even if I reduce the speed in the project settings, the "paste" button doesn’t work well. Therefore, I need to increase the quality of the "get" button a little, which makes the process slower.
If anyone could help me figure out how to perform this Control+C on a variable—essentially copying the data from a variable and leaving it in a Control+C state—I’d appreciate it. Thank you!
 

tharrkun

Client
Регистрация
05.09.2016
Сообщения
67
Благодарностей
8
Баллы
8
Not sure how to help with the CTRL+C, but here's my old C# snippet for CTRL+V:

C#:
var descr = project.Variables["your_variable_name"].Value;
System.Windows.Forms.Clipboard.SetText(descr);
instance.ActiveTab.KeyEvent("v","press","ctrl");
Maybe there's a way to CTRL + A the text and perform something like
C#:
instance.ActiveTab.KeyEvent("c","press","ctrl");
Won't hurt to give it a try :-)
 
  • Спасибо
Реакции: cesario678

cesario678

Client
Регистрация
10.03.2022
Сообщения
179
Благодарностей
13
Баллы
18
I got this one from the Russian forum

lock(SyncObjects.InputSyncer) // блокировка
{
var descr = project.Variables["content"].Value;

// сохраняем предыдущее состояние буфера
String previous_text = null;
previous_text = System.Windows.Forms.Clipboard.GetText();

// сохраняем нужный текст в буфер и вставляем его (программно делаем CTRL+V)
System.Windows.Forms.Clipboard.SetText(descr);
instance.ActiveTab.KeyEvent("v","press","ctrl");

// стираем буфер и возвращаем его к первоначальному состоянию
System.Windows.Forms.Clipboard.Clear();
System.Windows.Forms.Clipboard.SetText(previous_text);
}
 
  • Спасибо
Реакции: tharrkun

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)