-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypingClipboard.hta
72 lines (61 loc) · 1.23 KB
/
typingClipboard.hta
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<HEAD>
<TITLE>Typing Text</TITLE>
<HTA:APPLICATION
ID="oTypingText"
APPLICATIONNAME="Typing Text Sample"
CAPTION="YES"
SHOWINTASKBAR="YES"
SINGLEINSTANCE="YES"
SYSMENU="YES"
MAXIMIZEBUTTON="NO"
MINIMIZEBUTTON="NO"
INNERBORDER="NO"
BORDER="DIALOG"
SELECTION="NO"
WINDOWSTATE="NORMAL"
>
<SCRIPT LANGUAGE="JScript">
var shell = new ActiveXObject("WScript.shell");
function convertChar(ch)
{
if( ch==null ) return null;
switch(ch)
{
case "\r": return null;
case "\n": return "{ENTER}";
}
return "{"+ch+"}";
}
function sendKeys(s, i, tmin, tmax)
{
if( s==null ) return;
if( i>=s.length) return;
var ch = s.substring(i, i+1);
ch = convertChar(ch);
if( ch!=null )
shell.sendKeys(ch, true);
setTimeout(
function() {
sendKeys(s, i+1, tmin, tmax);
}, (Math.random()*(tmax-tmin+1)+tmin)
)
}
function typeClipboardText()
{
var s = window.clipboardData.getData("Text");
setTimeout(function () {
shell.AppActivate("Document - wordpad");
setTimeout(function() {
sendKeys(s, 0, 50, 200);
}, 350);
}, 350);
}
function init()
{
self.resizeTo(120, 90);
}
</SCRIPT>
</HEAD>
<BODY onLoad="init()" style="owerflow:hidden;" scroll="no">
<BUTTON onClick="typeClipboardText()" TYPE="button">Paste</BUTTON>
</BODY>