C:\my_script\mspaint\msPaint.ahk

;热键标记
; !感叹号代表Alt键
; # 井号代表 Windows 键
; ^ 上三角号代表 Ctrl键
; + 加号代表 Shift 键
; 执行
; ::代表按下前面快捷键后会执行后面的命令。


#IfWinActive ahk_exe Mspaint.exe
{
    ; ` 直线
    `::setLine()

    ; 1 曲线
    1::setCurve() 

    ; 2 矩形
    2::rectangle()

    ; 3 下箭头
    3::downArrow()

    4::selectArea()

    5::textInput()

    Space::srollDown()
}


setLine(){
    ; 清除上次的其他形状
    SendInput, {Alt}
    SendInput, {1}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,300
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Enter}
}

setCurve(){
    ; 清除上次的其他形状
    SendInput, {Alt}
    SendInput, {1}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,300
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Right}
    SendInput, {Enter}
}

rectangle(){
    ; 清除上次的其他形状
    SendInput, {Alt}
    SendInput, {1}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,300
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Right 3}
    SendInput, {Enter}
}
downArrow(){
    ; 清除上次的其他形状
    SendInput, {Alt}
    SendInput, {1}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,300
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Down 2}
    SendInput, {Enter}
}

selectArea(){
    SendInput, {Alt}
    SendInput, {1}
}

textInput(){
    SendInput, {Alt}
    SendInput, {2}
}


srollDown(){
    SendInput, {WheelDown}
}

C:\my_script\mspaint\msPaint2.ahk

;热键标记
; !感叹号代表Alt键
; # 井号代表 Windows 键
; ^ 上三角号代表 Ctrl键
; + 加号代表 Shift 键
; 执行
; ::代表按下前面快捷键后会执行后面的命令。


#IfWinActive ahk_exe Mspaint.exe
{
    ; ` 直线
    `::setLine()

    ; 1 曲线
    1::setCurve() 

    ; 2 矩形
    2::rectangle()

    ; 3 下箭头
    3::downArrow()

    4::selectArea()

    5::textInput()
}


setLine(){
    ; 清除上次的其他形状
    SendInput, {Alt}
    SendInput, {1}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,300
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Enter}
}

setCurve(){
    ; 清除上次的其他形状
    SendInput, {Alt}
    SendInput, {1}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,300
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Right}
    SendInput, {Enter}
}

rectangle(){
    ; 清除上次的其他形状
    SendInput, {Alt}
    SendInput, {1}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,300
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Right 3}
    SendInput, {Enter}
}
downArrow(){
    ; 清除上次的其他形状
    SendInput, {Alt}
    SendInput, {1}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,300
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Down 2}
    SendInput, {Enter}
}

selectArea(){
    SendInput, {Alt}
    SendInput, {1}
}

textInput(){
    SendInput, {Alt}
    SendInput, {2}
}

C:\my_script\mspaint\msPaintColor.ahk


#IfWinActive ahk_exe Mspaint.exe
{

    !R::red()

    !O::orange() 

    !Y::yellow()

    !G::green()

    !B::blue()

    !I::indigo()

    !P::purple()
	
	!W::white()
}



red(){
    MouseGetPos,x,y
    Click,532,71
    MouseMove,x,y
}
orange(){
    MouseGetPos,x,y
    Click,555,71
    MouseMove,x,y
}
yellow(){
    MouseGetPos,x,y
    Click,575,71
    MouseMove,x,y
}
green(){
    MouseGetPos,x,y
    Click,597,71
    MouseMove,x,y
}
blue(){
    MouseGetPos,x,y
    Click,619,71
    MouseMove,x,y
}
indigo(){
    MouseGetPos,x,y
    Click,642,71
    MouseMove,x,y
}
purple(){
    MouseGetPos,x,y
    Click,664,71
    MouseMove,x,y
}

white(){
	MouseGetPos,x,y
    Click,466,93
    MouseMove,x,y
}

C:\my_script\mspaint\msPaintColor_position_test.ahk


#IfWinActive ahk_exe Mspaint.exe
{
    

    !R::red()

    !O::orange() 

    !Y::yellow()

    !G::green()

    !B::blue()

    !I::indigo()

    !P::purple()
	
	!W::white()
}



red(){
    
    ; MouseMove,409,76

    ; WinGetPos, Xpos, Ypos,MSPaintApp ; 使用前面找到的窗口.
    ; MsgBox, Notepad is at %Xpos%`,%Ypos%
    ; MouseMove,404+Xpos,73+Ypos

    ControlGet, OutputVar, Line, 1, Edit1, Some Window Title

    ControlGet, WhichTab, Tab, , SysTabControl321, Some Window Title
    if ErrorLevel
        MsgBox There was a problem.
    else
        MsgBox Tab #%WhichTab% is active.


 
}
orange(){
    MouseGetPos,x,y
    Click,555,71
    MouseMove,x,y
}
yellow(){
    MouseGetPos,x,y
    Click,575,71
    MouseMove,x,y
}
green(){
    MouseGetPos,x,y
    Click,597,71
    MouseMove,x,y
}
blue(){
    MouseGetPos,x,y
    Click,619,71
    MouseMove,x,y
}
indigo(){
    MouseGetPos,x,y
    Click,642,71
    MouseMove,x,y
}
purple(){
    MouseGetPos,x,y
    Click,664,71
    MouseMove,x,y
}

white(){
	MouseGetPos,x,y
    Click,466,93
    MouseMove,x,y
}

C:\my_script\mspaint\mspaint_auo.ahk

#IfWinActive ahk_exe Mspaint.exe
{
    F3::setLine()
    F2::setCurve() 
    F5::rectangle()
    F6::downArrow()
    `::srollDown()
    F8::init()
}
; 清除上次的其他形状
clearHistory(){
    SendInput, {Alt}
    SendInput, {1}
}
setLine(){
    clearHistory()
    ; 中间需要延时一下,否则太快无法反应
    Sleep,500
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Enter}
}
setCurve(){
    ; 清除上次的其他形状
    clearHistory()
    ; 中间需要延时一下,否则太快无法反应
    Sleep,500
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Right}
    SendInput, {Enter}
}
rectangle(){
    ; 清除上次的其他形状
    clearHistory()
    ; 中间需要延时一下,否则太快无法反应
    Sleep,500
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Right 3}
    SendInput, {Enter}
}
downArrow(){
    ; 清除上次的其他形状
    clearHistory()
    ; 中间需要延时一下,否则太快无法反应
    Sleep,500
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Down 2}
    SendInput, {Enter}
}
srollDown(){
    SendInput, {WheelDown}
}

intiFontSize(){
    SendInput, {Alt}
    SendInput, {T}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,500
    ; 真正使用直线
    SendInput, {F}
    SendInput, {S}
    SendInput, 20
    SendInput, {Enter}
}
initSetLine(){
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Enter}
}
initSetLineWidth(){
    ; 设置宽度
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {S}
    SendInput, {Z}
    Sleep,500
    SendInput, {Down}
    SendInput, {Enter}
}
initSetTextInput(){
    SendInput, {Alt}
    SendInput, {2}
    Click
}
initSetTextBold(){
    SendInput, {Alt}
    SendInput, {T}
    Sleep,500
    SendInput, {F}
    SendInput, {B}
}
initFontColor(){
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {E}
    SendInput, {C}
    SendInput, {Tab 7}
    SendInput, 255
    SendInput, {Tab 4}
    SendInput, {Enter}
}
initBackColor(){
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {2}
    Sleep,500
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {E}
    SendInput, {C}
    SendInput, {Tab 7}
    SendInput, 0
    SendInput, {Tab}
    SendInput, 0
    SendInput, {Tab}
    SendInput, 0
    SendInput, {Tab 2}
    SendInput, {Enter}
}
initDeleteAll(){
    SendInput, {Ctrl Down}a{Ctrl Up}
    SendInput,{Delete}
}
init(){
    ; 设置Font Color
    initFontColor()
    Sleep,500
    initBackColor()
    Sleep,500
    initDeleteAll()
    Sleep,500
    ; 切换直线
    initSetLine()
    Sleep,500
    ; 设置线宽
    initSetLineWidth()
    Sleep,500
    ; 切换文字框
    initSetTextInput()
    Sleep,500
    ; 设置字体大小
    intiFontSize()
    Sleep,500
    ; 设置字体变粗
    initSetTextBold()
    Sleep,500
    ; 返回
    SendInput, {Alt}
    SendInput, {1}
    Sleep,500
    ; 返回,颜色选择重新切换到1
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {1}
}

C:\my_script\mspaint\mspaint_auo_fast.ahk

#IfWinActive ahk_exe Mspaint.exe
{
    F3::setLine()
    F1::setCurve() 
    F2::rectangle()
    F5::downArrow()
    F7::srollDown()
    F8::init()
    F6::selectRect()
    `::textInput()
}
; 清除上次的其他形状
clearHistory(){
    SendInput, {Alt}
    SendInput, {1}
}
setLine(){
    clearHistory()
    ; 中间需要延时一下,否则太快无法反应
    Sleep,200
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Enter}
}
setCurve(){
    ; 清除上次的其他形状
    clearHistory()
    ; 中间需要延时一下,否则太快无法反应
    Sleep,200
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Right}
    SendInput, {Enter}
}
rectangle(){
    ; 清除上次的其他形状
    clearHistory()
    ; 中间需要延时一下,否则太快无法反应
    Sleep,200
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Right 3}
    SendInput, {Enter}
}
downArrow(){
    ; 清除上次的其他形状
    clearHistory()
    ; 中间需要延时一下,否则太快无法反应
    Sleep,200
    ; 真正使用直线
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Down 2}
    SendInput, {Enter}
}
srollDown(){
    SendInput, {WheelDown}
}
selectRect(){
    SendInput, {Alt}
    SendInput, {1}
}
textInput(){
    SendInput, {Alt}
    SendInput, {2}
}


intiFontSize(){
    SendInput, {Alt}
    SendInput, {T}
    ; 中间需要延时一下,否则太快无法反应
    Sleep,500
    ; 真正使用直线
    SendInput, {F}
    SendInput, {S}
    SendInput, 20
    SendInput, {Enter}
}
initSetLine(){
    SendInput, {Alt}
    SendInput, {3}
    SendInput, {Enter}
}
initSetLineWidth(){
    ; 设置宽度
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {S}
    SendInput, {Z}
    Sleep,500
    SendInput, {Down}
    SendInput, {Enter}
}
initSetTextInput(){
    SendInput, {Alt}
    SendInput, {2}
    Click
}
initSetTextBold(){
    SendInput, {Alt}
    SendInput, {T}
    Sleep,500
    SendInput, {F}
    SendInput, {B}
}
initFontColor(){
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {E}
    SendInput, {C}
    SendInput, {Tab 7}
    SendInput, 255
    SendInput, {Tab 4}
    SendInput, {Enter}
}
initBackColor(){
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {2}
    Sleep,500
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {E}
    SendInput, {C}
    SendInput, {Tab 7}
    SendInput, 0
    SendInput, {Tab}
    SendInput, 0
    SendInput, {Tab}
    SendInput, 0
    SendInput, {Tab 2}
    SendInput, {Enter}
}
initDeleteAll(){
    SendInput, {Ctrl Down}a{Ctrl Up}
    SendInput,{Delete}
}
init(){
    ; 设置Font Color
    initFontColor()
    Sleep,500
    initBackColor()
    Sleep,500
    initDeleteAll()
    Sleep,500
    ; 切换直线
    initSetLine()
    Sleep,500
    ; 设置线宽
    initSetLineWidth()
    Sleep,500
    ; 切换文字框
    initSetTextInput()
    Sleep,500
    ; 设置字体大小
    intiFontSize()
    Sleep,500
    ; 设置字体变粗
    initSetTextBold()
    Sleep,500
    ; 返回
    SendInput, {Alt}
    SendInput, {1}
    Sleep,500
    ; 返回,颜色选择重新切换到1
    SendInput, {Alt}
    SendInput, {H}
    SendInput, {1}
}

C:\my_script\mspaint\Mspaint_Up_And_Down.ahk

; 浏览器截长图功能和画板上下滚动功能

GroupAdd browser, ahk_exe msedge.exe 
GroupAdd browser, ahk_exe chrome.exe
#IfWinActive ahk_group browser
{
    ^!`::screen()
}

#IfWinActive ahk_exe mspaint.exe
{
    !w::SendInput, {WheelUp}
    !s::SendInput, {WheelDown}
}


screen(){
    SendInput, {F12}
    Sleep, 3000
    SendInput, {CtrlDown}{ShiftDown}p{ShiftUp}{CtrlUp}
    Sleep, 2000
    SendInput, capture full
    Sleep, 1000
    SendInput, {Enter}
    Sleep, 3000
    SendInput, {F12}
}





原文地址:http://www.cnblogs.com/zhuoss/p/16907420.html

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长! 2. 分享目的仅供大家学习和交流,请务用于商业用途! 3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入! 4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解! 5. 如有链接无法下载、失效或广告,请联系管理员处理! 6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需! 7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员! 8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载 声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性