@@ -3,12 +3,19 @@ if not A_IsAdmin
3
3
Run * RunAs " %A_ScriptFullPath%"
4
4
ExitApp
5
5
}
6
+ #NoEnv
6
7
7
8
SendMode Input
8
9
SetWorkingDir , %A_ScriptDir %
9
10
10
11
#SingleInstance , Force
11
12
13
+ #IfWinActive ahk_class CabinetWClass
14
+ ^+p ::
15
+ pwshHere()
16
+ return
17
+ #IfWinActive
18
+
12
19
^+t ::
13
20
14
21
InputBox , userInput, Enter file name, , , 150 , 100
@@ -23,32 +30,46 @@ SetWorkingDir, %A_ScriptDir%
23
30
24
31
Exit
25
32
26
- ^+m ::
33
+ ^+d ::
27
34
28
35
InputBox , userInput, Enter file name, , , 150 , 100
29
36
30
- FileAppend , Secure File, * E:\Github\octocrypto\markdown\ %userInput%.md
37
+ FileAppend , Secure File, * C:\Users\gregg\Documents\MEGAsync\Documents\ %userInput%.docx
31
38
32
- ; RunWait, powershell.exe -File "Encrypt.ps1" "C:\Users\gregg\Documents\MEGAsync\Markdown \%userInput%.md ", , Hide
39
+ RunWait , powershell.exe - File " Encrypt.ps1" " C:\Users\gregg\Documents\MEGAsync\Documents \%userInput%.docx " , , Hide
33
40
34
41
Sleep , 5000
35
42
36
- ; Run, C:\Users\gregg\Documents\MEGAsync\Markdown\%userInput%-md.axx
37
-
38
- Run , E:\Github\octocrypto\markdown\%userInput%.md
43
+ Run , C:\Users\gregg\Documents\MEGAsync\Documents\%userInput%- docx.axx
39
44
40
45
Exit
41
46
42
- ^+c ::
47
+ ^+f ::
43
48
44
49
InputBox , userInput, Enter file name, , , 150 , 100
45
50
46
- FileAppend , Secure File, * C:\Users\gregg\Documents\MEGAsync\Crypto \%userInput%.txt
51
+ FileAppend , Secure File, * C:\Users\gregg\Documents\MEGAsync\Documents \%userInput%.pdf
47
52
48
- RunWait , powershell.exe - File " Encrypt.ps1" " C:\Users\gregg\Documents\MEGAsync\Crypto \%userInput%.txt " , , Hide
53
+ RunWait , powershell.exe - File " Encrypt.ps1" " C:\Users\gregg\Documents\MEGAsync\Documents \%userInput%.pdf " , , Hide
49
54
50
55
Sleep , 5000
51
56
52
- Run , C:\Users\gregg\Documents\MEGAsync\Crypto \%userInput%- txt .axx
57
+ Run , C:\Users\gregg\Documents\MEGAsync\Documents \%userInput%- pdf .axx
53
58
54
- Exit
59
+ Exit
60
+
61
+ pwshHere (){
62
+ If WinActive (" ahk_class CabinetWClass" ) || WinActive (" ahk_class ExploreWClass" ) {
63
+ If WinActive (" ahk_class CabinetWClass" ) || WinActive (" ahk_class ExploreWClass" ) {
64
+ WinHWND := WinActive ()
65
+ For win in ComObjCreate (" Shell.Application" ).Windows
66
+ If (win.HWND = WinHWND) {
67
+ dir := SubStr (win.LocationURL, 9 ) ; remove "file:///"
68
+ dir := RegExReplace (dir, " %20" , " " )
69
+ Break
70
+ }
71
+ }
72
+ Run , pwsh, % dir ? dir : A_Desktop
73
+ WinActivate , " Administrator: C:\Program Files\PowerShell\7\pwsh.exe"
74
+ }
75
+ }
0 commit comments