Skip to content

Instantly share code, notes, and snippets.

@jianjieluo
Created June 11, 2017 03:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jianjieluo/dd486c0724e21532168281c855b8c00b to your computer and use it in GitHub Desktop.
Save jianjieluo/dd486c0724e21532168281c855b8c00b to your computer and use it in GitHub Desktop.
windows下通过读文件自动打字q脚本-使用按键精灵
[General]
SyntaxVersion=2
BeginHotkey=121
BeginHotkeyMod=0
PauseHotkey=0
PauseHotkeyMod=0
StopHotkey=123
StopHotkeyMod=0
RunOnce=1
EnableWindow=
MacroID=a2892cd2-d123-44c6-a97b-b8d25020f719
Description=我的脚本1_自动备份
Enable=0
AutoRun=0
[Repeat]
Type=0
Number=1
[SetupUI]
Type=2
QUI=
[Relative]
SetupOCXFile=
[Comment]
[Script]
'==========以下是按键精灵录制的内容==========
Dim codefile, eachline, codefile_path,Text
Dim shoulparse
shouldparse = "~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:""ZXCVBNM<>?"
parseto = "`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./"
codefile_path = Plugin.File.SelectFile()
// codefile = Plugin.File.OpenFile(codefile_path)
Delay (5000)
// codefile = Plugin.File.OpenFile(codefile_path)
// Text = Plugin.File.ReadFileEx(codefile_path)
// TracePrint Text
// Dim debug_text
Dim fso
Set fso = CreateObject("Scripting.FileSystemobject")
Dim f
Set f=fso.OpenTextFile(codefile_path,1)
Do Until f.AtEndOfStream
strline = Trim(f.Readline)
For i=1 to len(strline)
Dim topress, pos
topress = mid(strline, i, 1)
debug_text = debug_text + topress
pos = InStr(shouldparse, topress)
If pos = 0 Then
If topress = Chr(13) or topress = Chr(10) Then
TracePrint "Get\n"
KeyPress Chr(13), 1
ElseIf topress = " " Then
TracePrint "Get Space"
KeyPress "Space", 1
Else
KeyPress topress, 1
End if
Else
TracePrint "Get toparse"
KeyDown "Shift", 1
KeyPress mid(parseto,pos,1), 1
KeyUp "Shift", 1
End if
TracePrint topress & ";"
Next
KeyPress "Enter",1
Loop
/*
For i=1 to len(Text)
Dim topress, pos
topress = mid(Text, i, 1)
debug_text = debug_text + topress
pos = InStr(shouldparse, topress)
If pos = 0 Then
If topress = Chr(13) or topress = Chr(10) Then
TracePrint "Get\n"
KeyPress Chr(13), 1
ElseIf topress = " " Then
TracePrint "Get Space"
KeyPress "Space", 1
Else
KeyPress topress, 1
End if
Else
TracePrint "Get toparse"
KeyDown "Shift", 1
KeyPress mid(parseto,pos,1), 1
KeyUp "Shift", 1
End if
TracePrint topress & ";"
Next
*/
// TracePrint debug_text
// Call lib.键盘.键盘按键组(Text,0,50)
// Plugin.File.CloseFile(codefile)
'==========以上是按键精灵录制的内容==========
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment