Advertisement
Guest User

Auto-refresh browsers on Ctrl+S inside Sublime Text 2

a guest
Feb 6th, 2012
2,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $^s::                                       ; only capture actual keystrokes
  2. SetTitleMatchMode, 2                        ; match anywhere in the title
  3. IfWinActive, Sublime Text 2                 ; find Sublime Text
  4. {
  5.     Send ^s                                 ; send save command
  6.     IfWinExist, Mozilla Firefox             ; find firefox
  7.     {
  8.         WinActivate                         ; use the window found above
  9.         Send ^r                             ; send browser refresh
  10.         WinActivate, Sublime Text 2         ; get back to Sublime Text
  11.     }
  12.     IfWinExist, Google Chrome               ; find Chrome
  13.     {
  14.         WinActivate                         ; use the window found above
  15.         Send ^r                             ; send browser refresh
  16.         WinActivate, Sublime Text 2         ; get back to Sublime Text
  17.     }
  18.     IfWinExist, Internet Explorer            ; find IE
  19.     {
  20.         WinActivate                         ; use the window found above
  21.         Send ^r                             ; send browser refresh
  22.         WinActivate, Sublime Text 2         ; get back to Sublime Text
  23.     }
  24. }
  25. else
  26. {
  27.     Send ^s                                 ; send save command
  28. }
  29. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement