; #=win !=alt ^=ctrl +=shift
;my special button is Browser_Search. Use it ot assign F10
;AAA********************************************************************************
; this is for autoHotKeys
Ctrl & F12::reload ; this will reload the autoHotKeys tool
Shift & F11::edit ; This will load this script in Editor, Notepad
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA********************************************************************************
;capture double click and do something
~LButton::
mousegetpos,,, wid, control
wingetclass, wclass, ahk_id %wid%
if (A_PriorHotkey = "~LButton" && A_TimeSincePriorHotkey < 400) ; double click
{
msgbox d2
; if (wclass = "Shell_TrayWnd" && control = "Button1") ; start
; run, explorer /e`, %location%
}
return
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA********************************************************************************
; This is for SSH, use 'Ctrl+c for Copy' and 'Ctrl+v for Paste' and 'Ctrl+q for Command Interrupt'
; use right ctrl for interrupt
; use "stty intr ^q" for command prompt inturrpt
;now Right Ctrl+q command to inturrupt in SSH. Use it instaed of Ctrl+c in SSH
Ctrl & c::
WinGetActiveTitle, title
ifInString,title,SSH Secure Shell
{
Send ^{Insert} ; change CTRL+C to CTRL+INSERT ; both are copy commands, but can't use in SSH
return
}
Send ^c
return
Ctrl & v::
WinGetActiveTitle, title
ifInString,title,SSH Secure Shell
{
Send +{Insert} ; change CTRL+V to SHIFT+INSERT ; both are PASTE commands, but can't use in SSH
return
}
Send ^v
return
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA********************************************************************************
; Middle button to move window to next monitor
; #a is defined in my other autohotkey
MButton::Send #a
;MButton::AltTabMenu ;AltTabMenu is special buuton..search for more
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA*******************************************************************************
;WheelLeft & WheelRight in SSH*
WheelLeft::
{
Send !{LEFT}
}
return
WheelRight::
{
Send !{RIGHT}
}
return
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA********************************************************************************
XButton1::
{
Send {PgDn}
}
return
XButton2::
{
Send {PgUp}
}
return
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA********************************************************************************
;if it is Toad, Show Single Record View
F1::
If WinActive("ahk_class TfrmMain")
{
WinGetActiveStats, title, width, height, x, y
;MsgBox, The active window "%title%" is %width% wide`, %height% tall`, and positioned at %x%`,%y%.
ypos := height-150
Click Right 450, %ypos% ; Mouse click below in DataGrid
Send s ;then send s letter which opens Single Record View
return
}
return
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA********************************************************************************
;if onenote exist, close it
F12::
if WinExist("ahk_class Framework::CFrame")
{
WinMinimize
return
}
return
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA********************************************************************************
;this will create a new folder in win explorer
F8::
if WinActive("ahk_class CabinetWClass")
{
my_time_string = %A_YYYY%%A_MMM%%A_DD%_%A_Hour%%A_Min%%A_Sec%
Send !fwf ; will create new dir
Send %my_time_string%
Send {HOME}
;Send {RETURN}
return
}
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA********************************************************************************
;map search button on(Mk700 mouse) to F10 or Browser_Search (Built-in Key)
Browser_Search::
;if its onenote, minimize
if WinActive("ahk_class Framework::CFrame")
{
Send {ALT}bi1{TAB}1{ENTER}{ALT}ba
return
}
;if explorer, create a new folder
if WinActive("ahk_class CabinetWClass")
{
my_time_string = %A_YYYY%%A_MMM%%A_DD%_%A_Hour%%A_Min%%A_Sec%
Send !fwf ; will create new dir
Send %my_time_string%
Send {HOME}
;Send {RETURN}
return
}
;if "Save As" dialoge box, insert date
;if open/save dialog, insert date
;ahk_class #32770 use windows-spy
if WinActive("Save As")
{
my_time_string = %A_YYYY%%A_MMM%%A_DD%_%A_Hour%%A_Min%%A_Sec%
;Send %A_Now%
Send %my_time_string%
return
}
; if "Open dialoge box, sort by date
if WinActive("Open")
{
Click 593,48
Click 593,159
Click 593,87
MouseMove 290,400
return
}
;if it is Toad, Open F4
If WinActive("ahk_class TfrmMain")
{
Send {Click}
Send {F4}
return
}
;if it is notepad++ or IE or Firefox -- changes tab
If WinActive("ahk_class Notepad++") | WinActive("ahk_class MozillaUIWindowClass") | WinActive("ahk_class IEFrame") | WinActive("ahk_class Chrome_XPFrame")
{
Send {Ctrl Down}{TAB}
Send {Ctrl Up}
return
}
/*
; if Firefox or IE or Chrome or OneNote, minimize windwows and
; then make notepad++ active. If opened notpad++ is not available, opens now
; If WinActive("ahk_class MozillaUIWindowClass") | WinActive("ahk_class IEFrame") | WinActive("ahk_class Chrome_XPFrame") | WinActive("ahk_class Framework::CFrame")
; {
; WinMinimize
; if WinExist("ahk_class Notepad++")
; {
; WinActivate
; return
; }
; if WinExist("ahk_class TfrmMain")
; {
; WinActivate
; return
; }
; run notepad++
; return
; }
*/
return
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;AAA********************************************************************************
;Assign extra button(search) to F10, just F10. press ctrl on keyboard and then press this button.
;in oneNote chnage Font and Size
;in Word and Outlook chnage Font and Size
;in winExplorerer Rename file wite date at the end.
^Browser_Search::
; in OneNote Chnage Font & Size
if WinActive("ahk_class Framework::CFrame")
{
Send ^+P
Send 11{Return} ;send ctrl+shift+P which is font size. then 10{enter} chnage it 10 size.
Send ^+F
Send Calibri{Return} ;send ctrl+shift+F which is font size. then 10{enter} chnage it 10 size.
return
}
;in Word and Outlook chanage Font and Size
if WinActive("ahk_class OpusApp") | WinActive("ahk_class rctrl_renwnd32")
{
Send ^+P
Send 11 ;send ctrl+shift+P which is font size. then 10{enter} chnage it 10 size.
Send !+F ; Send Alt+f to move cursor to font dropdown
Send Calibri{Return} ;send ctrl+shift+F which is font size. then 10{enter} chnage it 10 size.
return
}
;in winExplorerer Rename file with date at the end.
if WinActive("ahk_class CabinetWClass") ;this will create copy of a file
{
;local selectedFiles, file
ControlGet, selectedFiles, List, Selected Col1, SysListView321, ahk_class CabinetWClass
MsgBox %selectedFiles%
Loop, Parse, selectedFiles, `n ; Rows are delimited by linefeeds (`n).
{
file := A_LoopField
;msgbox "%file%"
IfInString,file,.
{
pos := StrLen(file) - InStr(file,".",false,0) + 1
my_time_string = %A_YYYY%%A_MMM%%A_DD%_%A_Hour%%A_Min%%A_Sec%
;Send {F2}{Shift Down}{Left %pos%}{Shift Up} ;don't delete
;Send {F2}{Shift Down}{Home}{Shift Up} ;don't delete
Send {F2}{Left %pos%}
Send _%my_time_string%
}
}
return
}
return
;ZZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
/*
---------------------------------------------
----------------------------------------------
----------------------------------------------
------------------------------------------------
-------------------Samples ----------------
*/
/*
Browser_Search::
{
msgbox "Browser_search"
return
}
return
*/
/*
If WinActive("ahk_class MozillaUIWindowClass") | WinActive("ahk_class IEFrame")
WinMinimize
*/
/*
#ifWinActive ahk_class CabinetWClass
Send !fwf
return
#ifWinActive
is same as
if WinActive("ahk_class CabinetWClass")
Send !fwf
return
}
*/
/*
if WinExist("ahk_class IEFrame")
WinMinimize
else if
Run Notepad++
else
Run Notepad
return
*/
;MButton::WinMinimize, A
/*
; MIddle button to open Notepad
MButton::
IfWinExist Untitled - Notepad
WinActivate
else
Run Notepad++
return
*/
/*
WheelDown::
MsgBox WG
Send {WheelDown}
return
; if no return, it will run the next command
; if {} around WheelDown, it will be Pasted. not treaked as command
*/
/*
; back/farword buttons
XButton1:: MsgBox XBBBBBBBBBBBBBB1
XButton2:: MsgBox XBBBBBBBBBBBBBB2
*/
; ^Down::WinMinimize, A ; Assign CTRL+DOWN hotkey to minimize the active window.
/*
;goto subroutine
#a::
gosub MoveWindowToNextScreen
return
*/
/*
;call finction
#a::
gMoveWindowToNextScreen()
return
*/
/*
; from http://www.autohotkey.com/forum/viewtopic.php?t=10085
GetExplorerSelectedFile()
{
local selectedFiles, file
ControlGet, selectedFiles, List, Selected Col1, SysListView321, ahk_class CabinetWClass
; MsgBox %selectedFiles%
Loop, Parse, selectedFiles, `n ; Rows are delimited by linefeeds (`n).
{
If (A_Index = 1)
file := A_LoopField
Else
ErrorLevel := A_Index ; Indicate that several files are selected, we return only the first one
}
Return file
}
*/
/*
if WinActive("ahk_class CabinetWClass") ;this will create copy of a file
{
;local selectedFiles, file
ControlGet, selectedFiles, List, Selected Col1, SysListView321, ahk_class CabinetWClass
;MsgBox %selectedFiles%
Loop, Parse, selectedFiles, `n ; Rows are delimited by linefeeds (`n).
{
file := A_LoopField
;msgbox "%file%"
IfInString,file,.
{
pos := StrLen(file) - InStr(file,".",false,0) + 1
my_time_string = %A_YYYY%%A_MMM%%A_DD%_%A_Hour%%A_Min%%A_Sec%
;Send {F2}{Shift Down}{Left %pos%}{Shift Up} ;don't delete
;Send {F2}{Shift Down}{Home}{Shift Up} ;don't delete
Send {F2}{Left %pos%}
Send _%my_time_string%
}
}
return
}
return
*/
/*
FileSelectFolder, myFolder
msgBox %myFolder%
*/
/*
;MButton::
;If WinActive("ahk_class MozillaUIWindowClass") | WinActive("ahk_class IEFrame") | WinActive("ahk_class Chrome_XPFrame") | WinActive("ahk_class Framework::CFrame")
;{
;Send #a
;}
;MButton::Send #a
;WheelDown::Send {F8}
;WheelUp::Send {F8}
;MButton & WheelDown::
;{
;Click
;WinMinimize,A
;}
;XButton1::Send {XButton1}
;XButton1 & LButton::
;{
;Click
;WinMinimize,A
;}
;WheelUp::
;{
;ControlGetFocus, fcontrol, A
;Loop 9 ; <-- Increase this value to scroll faster.
; SendMessage, 0x114, 1, 0, %fcontrol%, A ; 0x114 is WM_HSCROLL and the 1 after it is SB_LINERIGHT.
;return
;}
*/
/*
; you get this from windows-spy (right click on autoHotKey)
; NOTE: "Display full path in title bar" must be checked in "folder options" of Windows Explorer.
; if in WindowsExplorer -
; if clicked on blank area - create new folder with date
; if clicked on Directory - add date at end
; if clicked on file - add date before extention and
; strip "Copy of " if there is one - on File or Folder
;if "Save As" dialoge box, insert time
; if "Open" dialoge box, sort by date
; if Firefox or IE or Chrome or OneNote, minimize windwows and
; then make notepad++ active. If opened notpad++ is not available, opens now
;if it is Toad, Toggle SQL Window
;if it is notepad++ --chnages tab
;Click ; send click so it works for the window uder mouse, not the active window. --this has issues
; MouseGetPos, xpos, ypos
; Msgbox The cursor is at X%xpos% Y%ypos%
; if ypos < 26 ;clicked on title bar
; msgbox aaaaaaaaaaaa
; else
; msgbox bbbbbbbbb
; if in WindowsExplorer -
; if clicked on blank area - create new folder with date
; if clicked on Directory - add date at end
; if clicked on file - add date before extention and
; strip "Copy of " if there is one - on File or Folder
if WinActive("ahk_class CabinetWClass")
{
my_time_string = %A_YYYY%%A_MMM%%A_DD%_%A_Hour%%A_Min%%A_Sec%
;local selectedFiles, file ; this(local, define variable) is goog inside function only
ControlGet, selectedFiles, List, Selected Col1, DirectUIHWND3, ahk_class CabinetWClass
ControlGetText, path1, ToolbarWindow322, A
MsgBox %path1%
;MsgBox %selectedFiles%
; NOTE: "Display full path in title bar" must be checked in "folder options" of Windows Explorer.
WinGetActiveTitle apath
;msgbox %apath%
; if nothing was selected , create a folder and return immeidatly
If (StrLen(selectedFiles) = 0)
{
Send !fwf ; will create new dir
;Send %A_Now%
Send %my_time_string%
Send {RETURN}
return
}
; if something was selected , rename it
Loop, Parse, selectedFiles, `n ; Rows are delimited by linefeeds (`n).
{
file := A_LoopField
;msgbox "%file%"
IfInString,file,.
{
pos := StrLen(file) - InStr(file,".",false,0) + 1
;Send {F2}{Shift Down}{Left %pos%}{Shift Up} ;don't delete
;Send {F2}{Shift Down}{Home}{Shift Up} ;don't delete
;msgbox "%file%"
NewStr_noCopy := RegExReplace(file,"Copy of ", "") ; strip "Copy of "
NewStr := RegExReplace(NewStr_noCopy,"(\..*$)", "_XX123YYY_$1") ; add uniqe value
NewStr1 := RegExReplace(NewStr,"_XX123YYY_",my_time_string) ;replace uniq value with date
;msgbox %NewStr1%
FileMove %apath%/%file%, %apath%/%NewStr1%
;Send {F2}{Left %pos%}
;Send _%my_time_string%
;Send {Return}
}
else
{
;pp := StrLen(file) ; this is folder or file with no extention
;Send {F2}{Right 1}
;Send _%my_time_string%
NewStr_noCopy := RegExReplace(file,"Copy of ", "") ; strip "Copy of "
NewStr1 = %NewStr_noCopy%_%my_time_string%
msgbox %NewStr1%
FileMoveDir %apath%/%file%, %apath%/%NewStr1% ; this will rename folder
FileMove %apath%/%file%, %apath%/%NewStr1% ; this will rename file with no ext means no . in it
}
}
;msgbox "Rename Done"
return
}
*/