HoneyView筛图
黑莓键盘看剧
朗读剪贴板
复制网页文本(小说啥的)
选取文字函数
建立所在目录树形结构TXT.BAT
tree /F >> Menu.txt
Windows文件名非法字符替换函数
; HoneyView筛图.ahk
#a::
sleep 200
WinGetActiveTitle, title
StringGetPos, front, title, >
front := front + 2
StringTrimLeft, title, title, %front%
StringGetPos, end, title, [
StringLeft, title, title, %end%
StringGetPos, ext, title, ., R
ext := ext - 1
Stringleft, title, title, %ext%
FileAppend, %title%`n, 移动列表.txt
return
#d::
FileCreateDir 选中图片
Loop, Read, 移动列表.txt
{
list := A_LoopReadLine
if ( strlen(list) > 3)
{
loop, *.*
{
IfInString, a_loopfilename, %list%
FileMove, %a_loopfilename%, 选中图片
}
}
}
return
; 黑莓键盘看剧
Menu, Tray, Icon, blackberry.ico
q::
sleep 200
IfWinActive ahk_exe PotPlayerMini64.exe
send {Left}
return
p::
sleep 200
IfWinActive ahk_exe PotPlayerMini64.exe
send {Right}
return
; Win+1朗读剪贴板
menu, tray, icon, voice.ico
#1::
sleep 200
send ^c
sleep 100
ComObjCreate("SAPI.SpVoice").Speak(clipboard)
return
; 复制网页文本
#p::Pause
#a::
StartString = 下一頁
EndString = 目錄頁
FileCreateDir, 扒文成品
Send !d
Send 150
Send ^c
OldLink := clipboard
Send {Esc}
Send {Tab}
Loop
{
WholeText =
sleep 200
send ^a
sleep 100
send ^c
WholeText := clipboard
StringGetPos, StartPos, WholeText, %StartString%
if Errorlevel
{
FileAppend, %WholeText%, 扒文成品\全文.txt
Loop, Read, 扒文成品\全文.txt
{
If ( StrLen(A_LoopReadLine) > 0 )
FileAppend, %A_LoopReadLine%`n, 扒文成品\全文去空行.txt
}
MsgBox, , Congratulations`!, Done`!
return
}
StartPos := StartPos + StrLen(StartString)
StringTrimLeft, WholeText, WholeText, %StartPos%
StringGetPos, EndPos, WholeText, %EndString%
StringLeft, UsefulPart, WholeText, %EndPos%
FileAppend, %UsefulPart%, 扒文成品\全文.txt
Send ^f
Sleep 200
Send 下一頁
Sleep 50
Send {Enter}
Sleep 50
Send {Escape}
Sleep 50
Send {Enter}
Loop
{
sleep 2000
Send !d
sleep 100
Send ^c
NewLink := clipboard
If ( NewLink = OldLink )
continue
else
{
Send {Esc}
Sleep 50
Send {Tab}
OldLink := NewLink
break
}
}
}
return
; 选取文字函数
; 选取x与y之间文本函数示例
; x = `:
; y = is_
; z = asdg`:agdsagis_aglq
StringSelect(x, y, z)
{
StringGetPos, Xpos, z, %x%
Xpos := Xpos + StrLen(x)
StringTrimLeft, z1, z, %Xpos%
StringGetPos, Ypos, z1, %y%
StringLeft, z2, z1, %Ypos%
return z2
}
; Windows文件名非法字符替换函数
WinFileName(x)
{
StringReplace, x, x, /, -, All
StringReplace, x, x, ?, -, All
StringReplace, x, x, *, -, All
StringReplace, x, x, :, -, All
StringReplace, x, x, |, -, All
StringReplace, x, x, \, -, All
StringReplace, x, x, <, -, All
StringReplace, x, x, &, -, All
return x
}