diff options
author | John Ankarström <john@ankarstrom.se> | 2020-10-23 02:08:00 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-10-23 02:08:00 +0200 |
commit | 73bcdd66f3b4ce183bf8b9b0b5784830189c37f5 (patch) | |
tree | efa2430e10347638a21a01598c42c4280690fc26 /test/self | |
download | tt-73bcdd66f3b4ce183bf8b9b0b5784830189c37f5.tar.gz |
release 1.0
Diffstat (limited to 'test/self')
-rw-r--r-- | test/self/EXP=test.txt | 96 | ||||
-rw-r--r-- | test/self/OUT=test.txt | 96 | ||||
-rw-r--r-- | test/self/build.bat | 4 | ||||
-rw-r--r-- | test/self/test.txt | 96 |
4 files changed, 292 insertions, 0 deletions
diff --git a/test/self/EXP=test.txt b/test/self/EXP=test.txt new file mode 100644 index 0000000..edef5c2 --- /dev/null +++ b/test/self/EXP=test.txt @@ -0,0 +1,96 @@ +test + +;; -> init + +ShellApp := ComObjCreate("Shell.Application") +GroupAdd, Explorer, ahk_class CabinetWClass +GroupAdd, Explorer, ahk_class ExploreWClass + +;; -> library + +Explorer(hwnd := "") +{ + global ShellApp + if (hwnd = "") + WinGet, hwnd, id, A + for window in ShellApp.Windows + if (window.hwnd = hwnd) + return window + return -1 +} + +;; -> body + +#IfWinActive ahk_group Explorer + +^n::Run, % "explorer /n,""" Explorer().Document.Folder.Self.path """" +^p::Run, % "cmd /k cd /d """ Explorer().Document.Folder.Self.path """" + ++^p:: +path := Explorer().Document.Folder.Self.path +Run, % "C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Visual Studio 2010 Express\Visual Studio Command Prompt (2010).lnk" +WinWait, ahk_class ConsoleWindowClass +SendInput, % "cd " path "{Return}" +return + +LAlt & Up:: +RAlt & Up:: +e := Explorer() +path := e.Document.Folder.Self.path +if (InStr(path, "::{") = 1) + return +slash := InStr(path, "\", 0, 0) +if (slash = StrLen(path)) + slash := InStr(path, "\", 0, 0, 2) +if (slash = 0) + parent = ::{20D04FE0-3AEA-1069-A2D8-08002B30309D} ; My Computer +else + parent := SubStr(path, 1, slash) +e.Navigate(parent) +return + +LAlt & Down:: +RAlt & Down:: +path := Explorer().Document.Folder.Self.path +if (InStr(path, "::{") = 1) + return +Explorer().Navigate(path) ; go to real path of folder +return + +^+n:: +FileCreateDir, % Explorer().Document.Folder.Self.path "\New Folder" +SendInput, {F5}New Folder{F2} +return + +^!n:: +FileAppend,, % Explorer().Document.Folder.Self.path "\New Text Document.txt" +SendInput, {F5}New Text Document.txt{F2} +return + +^h:: +SSF_SHOWALLOBJECTS := 0x0001 +VarSetCapacity(SHELLSTATE, 32, 0) +DllCall("Shell32\SHGetSetSettings", "Ptr", &SHELLSTATE, "UInt", SSF_SHOWALLOBJECTS, "Int", false) +NumPut(NumGet(SHELLSTATE) ^ (1 << 0), SHELLSTATE,, "Int") +DllCall("Shell32\SHGetSetSettings", "Ptr", &SHELLSTATE, "UInt", SSF_SHOWALLOBJECTS, "Int", true) +WinGet, win, List, ahk_group Explorer +Loop, % win + PostMessage, 0x111, 41504,,, % "ahk_id " win%A_Index% ; refresh +return + +^q::PostMessage, 0x111, 30210, 0,, A ; sort by name +^w::PostMessage, 0x111, 30213, 0,, A ; sort by modified +^e::PostMessage, 0x111, 30212, 0,, A ; sort by type +^t::PostMessage, 0x111, 30214, 0,, A ; sort by created +^g::PostMessage, 0x111, 30209, 0,, A ; show in groups +^s::PostMessage, 0x111, 28717, 0,, A ; thumbnails +^d::PostMessage, 0x111, 28713, 0,, A ; icons +^i::PostMessage, 0x111, 28718, 0,, A ; tiles +^l::PostMessage, 0x111, 28715, 0,, A ; list +^f::PostMessage, 0x111, 28716, 0,, A ; details + +#IfWinActive + +;; -> .copy + +test diff --git a/test/self/OUT=test.txt b/test/self/OUT=test.txt new file mode 100644 index 0000000..edef5c2 --- /dev/null +++ b/test/self/OUT=test.txt @@ -0,0 +1,96 @@ +test + +;; -> init + +ShellApp := ComObjCreate("Shell.Application") +GroupAdd, Explorer, ahk_class CabinetWClass +GroupAdd, Explorer, ahk_class ExploreWClass + +;; -> library + +Explorer(hwnd := "") +{ + global ShellApp + if (hwnd = "") + WinGet, hwnd, id, A + for window in ShellApp.Windows + if (window.hwnd = hwnd) + return window + return -1 +} + +;; -> body + +#IfWinActive ahk_group Explorer + +^n::Run, % "explorer /n,""" Explorer().Document.Folder.Self.path """" +^p::Run, % "cmd /k cd /d """ Explorer().Document.Folder.Self.path """" + ++^p:: +path := Explorer().Document.Folder.Self.path +Run, % "C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Visual Studio 2010 Express\Visual Studio Command Prompt (2010).lnk" +WinWait, ahk_class ConsoleWindowClass +SendInput, % "cd " path "{Return}" +return + +LAlt & Up:: +RAlt & Up:: +e := Explorer() +path := e.Document.Folder.Self.path +if (InStr(path, "::{") = 1) + return +slash := InStr(path, "\", 0, 0) +if (slash = StrLen(path)) + slash := InStr(path, "\", 0, 0, 2) +if (slash = 0) + parent = ::{20D04FE0-3AEA-1069-A2D8-08002B30309D} ; My Computer +else + parent := SubStr(path, 1, slash) +e.Navigate(parent) +return + +LAlt & Down:: +RAlt & Down:: +path := Explorer().Document.Folder.Self.path +if (InStr(path, "::{") = 1) + return +Explorer().Navigate(path) ; go to real path of folder +return + +^+n:: +FileCreateDir, % Explorer().Document.Folder.Self.path "\New Folder" +SendInput, {F5}New Folder{F2} +return + +^!n:: +FileAppend,, % Explorer().Document.Folder.Self.path "\New Text Document.txt" +SendInput, {F5}New Text Document.txt{F2} +return + +^h:: +SSF_SHOWALLOBJECTS := 0x0001 +VarSetCapacity(SHELLSTATE, 32, 0) +DllCall("Shell32\SHGetSetSettings", "Ptr", &SHELLSTATE, "UInt", SSF_SHOWALLOBJECTS, "Int", false) +NumPut(NumGet(SHELLSTATE) ^ (1 << 0), SHELLSTATE,, "Int") +DllCall("Shell32\SHGetSetSettings", "Ptr", &SHELLSTATE, "UInt", SSF_SHOWALLOBJECTS, "Int", true) +WinGet, win, List, ahk_group Explorer +Loop, % win + PostMessage, 0x111, 41504,,, % "ahk_id " win%A_Index% ; refresh +return + +^q::PostMessage, 0x111, 30210, 0,, A ; sort by name +^w::PostMessage, 0x111, 30213, 0,, A ; sort by modified +^e::PostMessage, 0x111, 30212, 0,, A ; sort by type +^t::PostMessage, 0x111, 30214, 0,, A ; sort by created +^g::PostMessage, 0x111, 30209, 0,, A ; show in groups +^s::PostMessage, 0x111, 28717, 0,, A ; thumbnails +^d::PostMessage, 0x111, 28713, 0,, A ; icons +^i::PostMessage, 0x111, 28718, 0,, A ; tiles +^l::PostMessage, 0x111, 28715, 0,, A ; list +^f::PostMessage, 0x111, 28716, 0,, A ; details + +#IfWinActive + +;; -> .copy + +test diff --git a/test/self/build.bat b/test/self/build.bat new file mode 100644 index 0000000..2b48a07 --- /dev/null +++ b/test/self/build.bat @@ -0,0 +1,4 @@ +@echo off +setlocal +cd /d %~dp0 +..\..\tt -c"" -d";;" -oOUT= test.txt < test.txt
\ No newline at end of file diff --git a/test/self/test.txt b/test/self/test.txt new file mode 100644 index 0000000..776629c --- /dev/null +++ b/test/self/test.txt @@ -0,0 +1,96 @@ +<<.copy>> + +;; -> init + +ShellApp := ComObjCreate("Shell.Application") +GroupAdd, Explorer, ahk_class CabinetWClass +GroupAdd, Explorer, ahk_class ExploreWClass + +;; -> library + +Explorer(hwnd := "") +{ + global ShellApp + if (hwnd = "") + WinGet, hwnd, id, A + for window in ShellApp.Windows + if (window.hwnd = hwnd) + return window + return -1 +} + +;; -> body + +#IfWinActive ahk_group Explorer + +^n::Run, % "explorer /n,""" Explorer().Document.Folder.Self.path """" +^p::Run, % "cmd /k cd /d """ Explorer().Document.Folder.Self.path """" + ++^p:: +path := Explorer().Document.Folder.Self.path +Run, % "C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Visual Studio 2010 Express\Visual Studio Command Prompt (2010).lnk" +WinWait, ahk_class ConsoleWindowClass +SendInput, % "cd " path "{Return}" +return + +LAlt & Up:: +RAlt & Up:: +e := Explorer() +path := e.Document.Folder.Self.path +if (InStr(path, "::{") = 1) + return +slash := InStr(path, "\", 0, 0) +if (slash = StrLen(path)) + slash := InStr(path, "\", 0, 0, 2) +if (slash = 0) + parent = ::{20D04FE0-3AEA-1069-A2D8-08002B30309D} ; My Computer +else + parent := SubStr(path, 1, slash) +e.Navigate(parent) +return + +LAlt & Down:: +RAlt & Down:: +path := Explorer().Document.Folder.Self.path +if (InStr(path, "::{") = 1) + return +Explorer().Navigate(path) ; go to real path of folder +return + +^+n:: +FileCreateDir, % Explorer().Document.Folder.Self.path "\New Folder" +SendInput, {F5}New Folder{F2} +return + +^!n:: +FileAppend,, % Explorer().Document.Folder.Self.path "\New Text Document.txt" +SendInput, {F5}New Text Document.txt{F2} +return + +^h:: +SSF_SHOWALLOBJECTS := 0x0001 +VarSetCapacity(SHELLSTATE, 32, 0) +DllCall("Shell32\SHGetSetSettings", "Ptr", &SHELLSTATE, "UInt", SSF_SHOWALLOBJECTS, "Int", false) +NumPut(NumGet(SHELLSTATE) ^ (1 << 0), SHELLSTATE,, "Int") +DllCall("Shell32\SHGetSetSettings", "Ptr", &SHELLSTATE, "UInt", SSF_SHOWALLOBJECTS, "Int", true) +WinGet, win, List, ahk_group Explorer +Loop, % win + PostMessage, 0x111, 41504,,, % "ahk_id " win%A_Index% ; refresh +return + +^q::PostMessage, 0x111, 30210, 0,, A ; sort by name +^w::PostMessage, 0x111, 30213, 0,, A ; sort by modified +^e::PostMessage, 0x111, 30212, 0,, A ; sort by type +^t::PostMessage, 0x111, 30214, 0,, A ; sort by created +^g::PostMessage, 0x111, 30209, 0,, A ; show in groups +^s::PostMessage, 0x111, 28717, 0,, A ; thumbnails +^d::PostMessage, 0x111, 28713, 0,, A ; icons +^i::PostMessage, 0x111, 28718, 0,, A ; tiles +^l::PostMessage, 0x111, 28715, 0,, A ; list +^f::PostMessage, 0x111, 28716, 0,, A ; details + +#IfWinActive + +;; -> .copy + +test |