Advertisement
LoIIIs

Loïs's HK script

Feb 16th, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---- Opening folders
  2.  
  3. ;When I press F3, I want to open Dropbox
  4. F3:: Run C:\Users\user\Dropbox
  5. Statistics("hic")
  6. return
  7.  
  8. ;When I press F3, I want to open Download
  9. F4:: Run C:\Users\user\Downloads
  10.  
  11.  
  12.  
  13. ;--- Remaping
  14. LWin::Ctrl
  15. Insert:: return
  16.  
  17. ;When I press atl+x in Firefox, I want to activate alt+maj+a
  18. !x::
  19.    IfWinActive, ahk_class MozillaWindowClass
  20.       Send, !+a
  21. return
  22.  
  23. ;When I press alt+n, I want to create a new folder
  24. !n::send {AppsKey}wf
  25.  
  26.  
  27.  
  28. ; ---- Music Player
  29. ; When I press F12, I want to play the next song
  30. F12::
  31. Send {Media_Next}
  32. return
  33.  
  34. ;previous song
  35. F10::
  36. Send {Media_Prev}
  37. return
  38.  
  39. ;play/pause
  40. F1::
  41. Send {Media_Play_Pause}
  42. return
  43.  
  44. ;Volume mute
  45. F7::
  46. Send {Volume_Mute}
  47. return
  48.  
  49. ;Volume down
  50. F8::
  51. Send {Volume_Down}
  52. return
  53.  
  54. ;previous song
  55. F9::
  56. Send {Volume_Up}
  57. return
  58.  
  59.  
  60. ~Alt & WheelUp::  ; Scroll left.
  61.     Send {Volume_Up}
  62. return
  63.  
  64. ~Alt & WheelDown::  ; Scroll left.
  65. Loop 4
  66.     Send {Volume_Down}
  67. return
  68.  
  69.  
  70. ; --- Program Launching
  71. ; When I press alt+F, I want to open firefox
  72. !f::Run Firefox
  73.  
  74. ;When I press alt+w, I want to open the wordpress miiy menu
  75. !w::Run http://www.miiy.fr/wp-admin/
  76.  
  77. ;When I press alt+T, I want to open todo.txt
  78. !t::Run C:\Users\user\Dropbox\Pratique\to do.txt
  79.  
  80. ;When I press ², I want to open thunderbird
  81. ²::Run C:\Program Files\Mozilla Thunderbird\thunderbird.exe
  82.  
  83. ;When I press printscreen, I want to open the spinning tool
  84. PRINTSCREEN::Run, "C:\Windows\System32\SnippingTool.exe"
  85.  
  86. ;When I press F2, I want to launch evernote
  87. F2::Run Evernote
  88.  
  89. ; ---- Text completion
  90.  
  91. ;When I press cdlm, I want to print "Cordialement, Loïs Boullu
  92. ::cdlm:: Cordialement {enter} {enter} Loïs Boullu
  93.  
  94. ::çç::Ç
  95.  
  96. ::éé::É
  97.  
  98. ::beq::\begin{{}equation{}}{enter}{enter}\end{{}equation{}}
  99.  
  100. ::oe::œ
  101.  
  102.  
  103. ; Specials
  104. ;When I press Ctrl+D, I want to access the desktop
  105. ^D::
  106. Send, {LWin Down}d{LWin Up}
  107. Return
  108.  
  109. ;When I press alt+g, I want to search google for the highlighted text
  110. !g::
  111. ;Copy Clipboard to prevClipboard variable, clear Clipboard.
  112.   prevClipboard := ClipboardAll
  113.   Clipboard =
  114. ;Copy current selection, continue if no errors.
  115.   SendInput, ^c
  116.   ClipWait, 2
  117.   if !(ErrorLevel) {
  118. ;Convert Clipboard to text, auto-trim leading and trailing spaces and tabs.
  119.     Clipboard = %Clipboard%
  120. ;Clean Clipboard: change carriage returns to spaces, change >=1 consecutive spaces to +
  121.     Clipboard := RegExReplace(RegExReplace(Clipboard, "\r?\n"," "), "\s+","+")
  122. ;Open URLs, Google non-URLs. URLs contain . but do not contain + or .. or @
  123.     if Clipboard contains +,..,@
  124.       Run www.google.com/search?q=%Clipboard%
  125.     else if Clipboard not contains .
  126.       Run www.google.com/search?q=%Clipboard%
  127.     else
  128.       Run %Clipboard%
  129.   }
  130. ;Restore Clipboard, clear prevClipboard variable.
  131.   Clipboard := prevClipboard
  132.   prevClipboard =
  133. return
  134.  
  135.  
  136. Statistics(id)
  137. {
  138.     FormatTime, vdate, ddMMyyyy
  139.     FileAppend,%vdate% | %id% `n , F:\hotkeys.txt
  140. }
  141.  
  142.  
  143. Alt & Enter:: ; alt+enter to maximize the window
  144. WinGet, TempWindowID, ID, A
  145. If (WindowID != TempWindowID)
  146. {
  147.   WindowID:=TempWindowID
  148.   WindowState:=0
  149. }
  150. If (WindowState != 1)
  151. {
  152.   WinGetPos, WinPosX, WinPosY, WindowWidth, WindowHeight, ahk_id %WindowID%
  153.   WinSet, Style, ^0xC40000, ahk_id %WindowID%
  154.   WinMove, ahk_id %WindowID%, , 0, 0, A_ScreenWidth, A_ScreenHeight
  155. }
  156. Else
  157. {
  158.   WinSet, Style, ^0xC40000, ahk_id %WindowID%
  159.   WinMove, ahk_id %WindowID%, , WinPosX, WinPosY, WindowWidth, WindowHeight
  160. }
  161. WindowState:=!WindowState
  162. return
  163.  
  164.  
  165. ~LButton & RButton::
  166.     {
  167.     Sleep, 100
  168.     Send {Media_Next}
  169.     Return
  170.     }
  171.    
  172. ~RButton & LButton::
  173.     {
  174.     Sleep, 100
  175.     Send {Media_Prev}
  176.     Return
  177.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement