VBS: write jumble of articles

Dim ws
Set ws=WScript.CreateObject("WScript.Shell")

arrDict=array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")

Function Random(m,n)
	Randomize
	Random = Int(((n-m+1) * Rnd) + m)
End Function

outLen = 1000
idxMin = lbound(arrDict)
idxMax = ubound(arrDict)

do
	ws.Run "%windir%\notepad.exe"
	ws.AppActivate "无标题-记事本"
	nowTime=year(Now)&Month(Now)&day(Now)&"-"&Hour(Now)&Minute(Now)&Second(Now)
	WScript.Sleep 1500

	ws.sendKeys nowTime & "\r\n"
	For i = 1 To outLen
		idxRdm = Random(idxMin, idxMax)
		ws.sendkeys "" & arrDict(idxRdm) & ""
		'ws.SendKeys "^{v}"
	next

	'Ctrl+S
	ws.SendKeys "^{s}"
	WScript.Sleep 200
	ws.AppActivate "另存为"
	ws.SendKeys nowTime
	WScript.Sleep 300
	ws.SendKeys "%s"

	WScript.Sleep 500
	ws.sendKeys "%{F4}"
'  ws.SendKeys "{enter}"
	WScript.Sleep 5000
Loop

猜你喜欢

转载自www.cnblogs.com/xinyueliu/p/12693158.html
vbs
今日推荐