; Ankuaichajian `(tilde ~ that is where the keyboard) to open immediately carry U disk office dedicated folder

; Ankuaichajian `(tilde ~ that is where the keyboard) to open immediately carry U disk office dedicated folder
; WorkFolderHotkey.ahk
;
; http://www.autoahk.com/
; HTTPS: //www.cnblogs .com / delphixx / P / 12129024.html
; http://autohotkey.bokee.com/507525091.html

Hotkey, ``, open U-dedicated portable office
: *: / wk ::
open U-dedicated portable office ()
return
;
open U-dedicated portable office ()
{
; detecting whether the operation was successful operation timing timer period should be greater than period's (i.e., 500 greater than 100)
the SetTimer, AllMissionComplete, 500
the SetTimer, OpenWorkFolder, 100
the SetTimer, ActivateWorkFolder, 100
the SetTimer, ReSizeWorkFolder, 100
}
;
AllMissionComplete ()
{
IF (OpenCount> 100)
{
the SetTimer, AllMissionComplete, the Delete
the SetTimer, OpenWorkFolder , the Delete
SetTimer, ActivateWorkFolder, the Delete
SetTimer, ReSizeWorkFolder, the Delete
ToolTip, did not find the portable U disk U disk _ connect portable computers to
SetTimer, RemoveToolTip, 3000
}
IfWinActive ,, 01_ office file
{
WinGetPos,X,Y,,,,01_办公文件
if(A_ScreenWidth/2-X=0)
{
SetTimer,AllMissionComplete,Delete
SetTimer,OpenWorkFolder,Delete
SetTimer,ActivateWorkFolder,Delete
SetTimer,ReSizeWorkFolder,Delete
}
}
}
;
OpenWorkFolder()
{
OpenCount++
IfWinNotExist,,01_办公文件
{
DriveGet,DriveList,List
loop,Parse,DriveList
{
DriveGet,USBDriveLabel,Label,%A_LoopField%:
IfInString,USBDriveLabel, 随身U盘
{
FileCreateDir,%A_LoopField%:\01_办公文件
Run,%A_LoopField%:\01_办公文件
}
}
}
}
;
ActivateWorkFolder()
{
WinShow ,, 01_ office documents
WinActivate ,, 01_ office documents
}
;
ReSizeWorkFolder ()
{
WinMove ,, 01_ office files, A_ScreenWidth / 2,0, A_ScreenWidth / 2, A_ScreenHeight-35
}
;
RemoveToolTip:
the SetTimer, RemoveToolTip, OFF
ToolTip
return

Guess you like

Origin www.cnblogs.com/delphixx/p/12129024.html