SingleInstance force Persistent ; 为了进行演示, 当用户选择 "No" 时让脚本持续运行. SetTitleMatchMode RegEx ;~ PostMessage, 1075, 2029, 0, ,
#SingleInstance force
#Persistent ; 为了进行演示, 当用户选择 "No" 时让脚本持续运行.
SetTitleMatchMode RegEx
;~ PostMessage, 1075, 2029, 0, , ahk_class TTOTAL_CMD ;获取tc中左边的路径
this_title=
WinWaitActive,ahk_class CabinetWClass|TTOTAL_CMD
if WinActive("ahk_class CabinetWClass")
gosub cheack
;~ else if WinActive("ahk_class TTOTAL_CMD")
else
gosub total
return
cheack:
this_title=
Loop,
{
WinGetTitle, this_title, ahk_class CabinetWClass
if this_title=计算机
{
continue
}
WinWaitNotActive,%this_title%
if WinActive("ahk_class CabinetWClass",,"%this_title%")
{
Sleep 200
continue
;~ return
}
else if WinActive("ahk_class TTOTAL_CMD")
{
gosub total
}
else if this_title=桌面
{
this_title=%A_Desktop%
WinWaitActive,另存为|保存|复制|新建|打开|图形另存为|文件打开|保存副本|上传|选择文件
gosub zhixing
}
WinWaitActive,另存为|保存|复制|新建|打开|图形另存为|文件打开|保存副本|上传|选择文件
gosub zhixing
}
return
total:
this_title=
Loop,
{
if WinActive("ahk_class TTOTAL_CMD"){
PostMessage, 1075, 2029, 0, , ahk_class TTOTAL_CMD ;获取tc中左边的路径
this_title=% Clipboard
Sleep 200
continue
}
else if WinActive("ahk_class CabinetWClass")
{
gosub cheack
}
else
{
WinWaitNotActive,ahk_class TTOTAL_CMD
;~ WinWaitActive,ahk_class #32770
WinWaitActive,另存为|保存|复制|新建|打开|图形另存为|文件打开|保存副本|上传|选择文件
gosub zhixing
}
}
return
zhixing:
if (this_title=this)
{
;~ this=%this_title%
this_title=
WinWaitActive,ahk_class CabinetWClass|TTOTAL_CMD
if WinActive("ahk_class CabinetWClass")
gosub cheack
;~ else if WinActive("ahk_class TTOTAL_CMD")
else
gosub total
}
else{
;~ ControlClick, Edit1, ahk_class #32770
ControlClick, Edit1, 另存为|保存|复制|新建|打开|图形另存为|文件打开|保存副本|上传|选择文件
Sleep, 100 ; It needs extra time on some dialogs or in some cases.
;~ ControlSetText, Edit1, %this_title%, ahk_class #32770 ;给打开保存对话框的编辑控件赋值,但是赋值失败,不知道为什么
ControlSetText, Edit1, %this_title%, 另存为|保存|复制|新建|打开|图形另存为|文件打开|保存副本|上传|选择文件 ;给打开保存对话框的编辑控件赋值,但是赋值失败,不知道为什么
Sleep, 100
;~ ControlSend, Edit1, {Enter}, ahk_class #32770
ControlSend, Edit1, {Enter}, 另存为|保存|复制|新建|打开|图形另存为|文件打开|保存副本|上传|选择文件
this=%this_title%
this_title=
WinWaitActive,ahk_class CabinetWClass|TTOTAL_CMD
if WinActive("ahk_class CabinetWClass")
gosub cheack
;~ else if WinActive("ahk_class TTOTAL_CMD")
else
gosub total
}
return
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

