Advertisement
renard162

Untitled

Aug 7th, 2022
1,129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ;Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ;Enable warnings to assist with detecting common errors.
  3. SendMode Input  ;Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ;Ensures a consistent starting directory.
  5. menu, tray, icon, %A_ScriptDir%\Icons\input_keyboard.ico ;Determina o ícone da system tray com o script ativado.
  6.  
  7.  
  8. ;Teclas de atalho
  9. Launch_App2:: SpeedCrunch()         ;Calc
  10. ^Launch_App2:: Calculator()         ;Ctrl + Calc
  11. !Launch_App2:: altHP()              ;Alt + Calc
  12. ^Media_Play_Pause:: Aimp()          ;Ctrl + Play/Pause
  13. ^!+Esc:: ProcessExplorer()          ;Ctrl + Alt + Shift + Esc
  14. AppsKey:: Cmder()                   ;Context Menu
  15. ^AppsKey:: Cmd()                    ;Ctrl + Context Menu
  16. <^>!AppsKey:: WindowsTerminal()     ;AltGr + Context Menu
  17. ^<#E:: MultiCommander()             ;Ctrl + Super + E
  18. !PrintScreen:: Lightshot()          ;Alt + Print Screen
  19.  
  20. ;Desabilita combinações de teclas com calculadora para evitar "flood" de calculadoras abertas.
  21. +Launch_App2:: Return               ;Shift + Calc
  22. #Launch_App2:: Return               ;Super + Calc
  23. +^Launch_App2:: Return              ;Shift + Ctrl + Calc
  24. +#Launch_App2:: Return              ;Shift + Super + Calc
  25. +!Launch_App2:: Return              ;Shift + Alt + Calc
  26. ^#Launch_App2:: Return              ;Ctrl + Super + Calc
  27. ^!Launch_App2:: Return              ;Ctrl + Alt + Calc (AltGr + Calc)
  28. #!Launch_App2:: Return              ;Super + Alt + Calc
  29. +^#Launch_App2:: Return             ;Shift + Ctrl + Super + Calc
  30. +^!Launch_App2:: Return             ;Shift + Ctrl + Alt + Calc
  31. +^#!Launch_App2:: Return            ;Shift + Ctrl + Super + Alt + Calc
  32.  
  33.  
  34.  
  35.  
  36.  
  37. ;Minimiza/Restaura a calculadora padrão.
  38. ;Caso o processo não esteja aberto, executa a calculadora.
  39. Calculator() {
  40.     if WinExist("Calculator ahk_class CalcFrame") or WinExist("Calculator ahk_class ApplicationFrameWindow")
  41.     {
  42.         if WinActive()
  43.         {
  44.             WinMinimize
  45.             Return
  46.         }
  47.         else
  48.         {
  49.             WinActivate
  50.             Return
  51.         }
  52.     }
  53.     else
  54.     {
  55.         Run, calc.exe
  56.         Return
  57.     }
  58. }
  59.  
  60.  
  61. ;Minimiza/Restaura a calculadora SpeedCrunch.
  62. ;Caso o processo não esteja aberto, executa a calculadora antes de colocá-la em foco.
  63. SpeedCrunch() {
  64.     Process, Exist, speedcrunch.exe
  65.     If ErrorLevel
  66.     {
  67.         IfWinNotActive SpeedCrunch
  68.         {
  69.             WinShow, SpeedCrunch ahk_pid %ErrorLevel%
  70.             Sleep 50
  71.             WinActivate, SpeedCrunch ahk_pid %ErrorLevel%
  72.             Return
  73.         }
  74.         else
  75.         {
  76.             WinMinimize, SpeedCrunch ahk_pid %ErrorLevel%
  77.             Return
  78.         }
  79.     }
  80.     Else
  81.     {
  82.         Run, %A_ScriptDir%\SpeedCrunch\speedcrunch.exe
  83.         WinWait, SpeedCrunch
  84.         WinActivate, SpeedCrunch
  85.         Return
  86.     }
  87. }
  88.  
  89. ;Minimiza/Restaura a calculadora altHP.
  90. ;Caso o processo não esteja aberto, executa a calculadora.
  91. altHP() {
  92.     if WinExist("IPython: D:Tools/altHP") or WinExist("Select IPython: D:Tools/altHP")
  93.     {
  94.         if WinActive()
  95.         {
  96.             WinMinimize
  97.             Return
  98.         }
  99.         else
  100.         {
  101.             WinActivate
  102.             Return
  103.         }
  104.     }
  105.     else
  106.     {
  107.         Run, %A_ScriptDir%\altHP\calc.bat, %A_ScriptDir%\altHP\
  108.         WinWait, IPython: D:Tools/altHP
  109.         WinActivate, IPython: D:Tools/altHP
  110.         Return
  111.     }
  112. }
  113.  
  114. ;Coloca o prompt Cmder em foco.
  115. ;Caso o processo não esteja aberto, executa o aplicativo antes de colocá-lo em foco.
  116. Cmder() {
  117.     Process, Exist, ConEmu64.exe
  118.     If ErrorLevel
  119.     {
  120.         IfWinNotActive Cmder
  121.         {
  122.             Sleep 200
  123.             WinActivate, Cmder
  124.             Return
  125.         }
  126.     }
  127.     Else
  128.     {
  129.         Run, C:\Cmder\Cmder.exe
  130.         WinWait, Cmder
  131.         WinActivate, Cmder
  132.         Return
  133.     }
  134. }
  135.  
  136.  
  137. ;Coloca o Windows Terminal em foco.
  138. ;Caso o processo não esteja aberto, executa o prompt.
  139. WindowsTerminal() {
  140.     Process, Exist, WindowsTerminal.exe
  141.     If ErrorLevel
  142.     {
  143.         IfWinNotActive ahk_class CASCADIA_HOSTING_WINDOW_CLASS
  144.         {
  145.             Sleep 200
  146.             WinActivate, ahk_class CASCADIA_HOSTING_WINDOW_CLASS
  147.             Return
  148.         }
  149.     }
  150.     Else
  151.     {
  152.         Run, wt.exe
  153.         WinWait, ahk_class CASCADIA_HOSTING_WINDOW_CLASS
  154.         WinActivate, ahk_class CASCADIA_HOSTING_WINDOW_CLASS
  155.         Return
  156.     }
  157. }
  158.  
  159.  
  160. ;Executa o prompt Cmd.
  161. Cmd() {
  162.     Run, cmd.exe
  163.     WinWait, C:\WINDOWS\SYSTEM32\cmd.exe
  164.     WinActivate, C:\WINDOWS\SYSTEM32\cmd.exe
  165.     Return
  166. }
  167.  
  168.  
  169. ;Coloca o aplicativo Multi Commander em foco.
  170. ;Caso o processo não esteja aberto, executa o aplicativo antes de colocá-lo em foco.
  171. MultiCommander() {
  172.     Process, Exist, MultiCommander.exe
  173.     If ErrorLevel
  174.     {
  175.         IfWinNotActive Multi Commander (x64)  v9.6.1 (build 2582) Portable
  176.         {
  177.             Sleep 100
  178.             WinActivate, Multi Commander (x64)  v11.0 (build 2770) Portable
  179.             Return
  180.         }
  181.     }
  182.     Else
  183.     {
  184.         Run, %A_ScriptDir%\Multi Commander\x64\MultiCommander.exe
  185.         WinWait, Multi Commander (x64)  v11.0 (build 2770) Portable
  186.         WinActivate, Multi Commander (x64)  v11.0 (build 2770) Portable
  187.         Return
  188.     }
  189. }
  190.  
  191.  
  192. ;Executa o aplicativo Process Explorer.
  193. ProcessExplorer() {
  194.     Process, Exist, procexp64.exe
  195.     If !ErrorLevel
  196.     {
  197.         Run, %A_ScriptDir%\Process Explorer\procexp64.exe
  198.         WinWait, Process Explorer
  199.         WinActivate, Process Explorer
  200.         Return
  201.     }
  202.     Else
  203.     {
  204.         IfWinNotActive Process Explorer
  205.         {
  206.             Sleep 200
  207.             WinActivate, Process Explorer
  208.             Return
  209.         }
  210.     }
  211. }
  212.  
  213. ;Executa o player AIMP.
  214. Aimp() {
  215.     Process, Exist, AIMP.exe
  216.     If !ErrorLevel
  217.     {
  218.         Run, %A_ScriptDir%\AIMP\AIMP.exe
  219.     }
  220.     Return
  221. }
  222.  
  223.  
  224. ;Executa ou finaliza a ferramenta de Screen Shot Lightshot.
  225. Lightshot() {
  226.     Process, Exist, Lightshot.exe
  227.     If !ErrorLevel
  228.     {
  229.         Run, C:\Program Files (x86)\Skillbrains\lightshot\Lightshot.exe
  230.         return
  231.     }
  232.     else
  233.     {
  234.         Process, Close, Lightshot.exe
  235.         Return
  236.     }
  237. }
  238.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement