Mandrew

Screendump (snippet from HotSweet.ahk)

Aug 2nd, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. VerNo = 0.912
  2. tt := "Hotsweet " . VerNo . " - "
  3. /*
  4. **********
  5. SCREENDUMP
  6. **********
  7. Whenever you hit the printscreen key, it will automatically save the picture in a folder of your choice using an automatic
  8. naming scheme.
  9.  
  10. Unfortunately, this feature will not work without IrfanView installed because I cannot crack the internal clipboard format used by AutoHotKey.
  11.  
  12. IRFANVIEW CAN BE DOWNLOADED FROM HTTP://WWW.IRFANVIEW.COM/
  13. */
  14. ~PrintScreen::
  15. Sleep 30
  16. ImageToSave := ClipboardAll
  17. Loop {
  18.     IDNumber := ""
  19.     Loop % DumpNumberWidth - StrLen(A_Index) {
  20.         IDNumber .= "0"
  21.     }
  22.     IDNumber .= A_Index
  23.     ShortFileName := DumpFilePrefix . IDNumber . DumpExtension
  24.     FileName := A_WorkingDir . "\Screendumps\" . ShortFileName
  25. } Until !FileExist(FileName)
  26. Run, i_view32.exe /clippaste /convert=%FileName%, C:\Program Files (x86)\IrfanView\
  27. If (!ErrorLevel)
  28.  
  29.  
  30.  
  31.  
  32.     ToolTipDisplay(tt . "Screenshot successfully saved to " . ShortFileName,-1000)
  33. Else
  34.     ToolTipDisplay(tt . "Screenshot save failed. Please make sure IrfanView is properly installed in its default directory.",-4000)
  35. Return
  36.  
  37. ; Tooltip display function and removal subroutine.
  38. ToolTipDisplay(Message, Delay) {
  39.     ToolTip, %Message%
  40.     SetTimer, RemoveToolTip, %Delay%
  41.     Return
  42. }
  43.  
  44. RemoveToolTip:
  45. SetTimer, RemoveToolTip, Off
  46. ToolTip
  47. Return
Add Comment
Please, Sign In to add comment