Last active
July 11, 2018 14:13
-
-
Save mniak/854dbe107d3064bb0306c4aeab721066 to your computer and use it in GitHub Desktop.
SendKey scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Threading; | |
using System.Windows.Forms; | |
public void TypeKeys(string text, bool trimNums=true) { | |
if (trimNums) { | |
text = Regex.Replace(text, "[^0-9]", ""); | |
} | |
for (int i = 0; i < text.Length; i++) { | |
SendKeys.SendWait(text[i].ToString()); | |
Thread.Sleep(50); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SendKeys | |
import re | |
import time | |
def type(text, trimNums=True): | |
time.sleep(2) | |
if trimNums: | |
text = re.sub('[^0-9]', '', text) | |
for k in text: | |
SendKeys.SendKeys(k) | |
time.sleep(0.01) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment