Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sending multiple lines of text
#4
Code:
Copy      Help
wnd.switchActiveWindow();
300.ms();

string R = """
hello:

world?

Hi!
"""
;

keys2.SendTextWithShiftEnter(R);


static class keys2 {
    /// <summary>
    ///
Sends text like <see cref="keys.sendt"/>. For newlines sends <c>Shift+Enter</c> inetead of <c>Enter</c>.
    /// </summary>
    ///
<param name="s"></param>
    public static void SendTextWithShiftEnter(string s) {
        var k = new keys(opt.key);
        foreach (var m in s.RxFindAll(@"(.+)|\R")) {
            var v = m.Value;
            if (m[1].Exists) k.AddText(m.Value); else k.AddKeys("Shift+Enter");
        }

        k.SendNow();
    }
}


Messages In This Thread
Sending multiple lines of text - by Davider - 03-08-2024, 05:07 AM
RE: Sending multiple lines of text - by Davider - 03-08-2024, 05:52 AM
RE: Sending multiple lines of text - by Gintaras - 03-08-2024, 05:59 AM
RE: Sending multiple lines of text - by Gintaras - 03-08-2024, 06:40 AM
RE: Sending multiple lines of text - by Davider - 03-08-2024, 07:08 AM
RE: Sending multiple lines of text - by Gintaras - 03-08-2024, 09:28 AM
RE: Sending multiple lines of text - by Gintaras - 03-09-2024, 07:39 AM
RE: Sending multiple lines of text - by Davider - 03-28-2024, 08:58 AM
RE: Sending multiple lines of text - by Gintaras - 03-28-2024, 09:13 AM
RE: Sending multiple lines of text - by Davider - 03-28-2024, 09:16 AM
RE: Sending multiple lines of text - by Gintaras - 03-28-2024, 09:28 AM
RE: Sending multiple lines of text - by Davider - 03-30-2024, 10:35 AM
RE: Sending multiple lines of text - by Gintaras - 03-30-2024, 12:09 PM
RE: Sending multiple lines of text - by Davider - 03-30-2024, 02:00 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)