Autoit Screen Capture Program


/ Published in: AutoIt
Save to your folder(s)

This took me not very long...


Copy this code and paste it in your HTML
  1. HotKeySet ( "{F10}", "DID_CLICK" )
  2. HotKeySet ( "{F11}", "CLOSE" )
  3. TraySetToolTip("Mr.Numbers Quick Screen Shot")
  4. Opt("TrayMenuMode",1)
  5.  
  6. $JPEG_ITEM = TrayCreateItem("JPEG")
  7. $PNG_ITEM = TrayCreateItem("PNG")
  8. $BMP_ITEM = TrayCreateItem("BMP")
  9. $EXIT_ITEM = TrayCreateItem("Exit")
  10.  
  11.  
  12. MsgBox( 0, "Mr.Numbers Quick Screen Shot", "Welcome to Mr.Numbers quick screen shot tool! Using this tool, you can take quick screenshots!")
  13. MsgBox( 0, "Mr.Numbers Quick Screen Shot", "Please tell me where to save your files!")
  14. $WINDOWSPATH = FileSelectFolder ( "Choose A Folder", "" , 1 )
  15.  
  16. If $WINDOWSPATH = "" Then
  17. Exit 0
  18.  
  19. MsgBox( 0, "Mr.Numbers Quick Screen Shot", "Press OK to start your screen capturing! Simply press F10! (Your clipboard will be erased)")
  20. MsgBox( 0, "Mr.Numbers Quick Screen Shot", "Edit the DATA.INI File to change the desired file format")
  21. MsgBox( 0, "Mr.Numbers Quick Screen Shot", "Press F11 to close this program")
  22. $NUMBER = IniRead( $WINDOWSPATH & "\" & "DATA.INI", "INI", "NUMBER", "x")
  23. If $NUMBER = "X" Then
  24. IniWrite( $WINDOWSPATH & "\DATA.INI", "INI", "NUMBER", "1")
  25. IniWrite( $WINDOWSPATH & "\DATA.INI", "INI", "FILETYPE", "JPEG")
  26. IniWrite( $WINDOWSPATH & "\DATA.INI", "COMMENTS", "DIFFERENT FILE TYPES", "JPEG, PNG, BMP")
  27. $NUMBER = IniRead( $WINDOWSPATH & "\" & "DATA.INI", "INI", "NUMBER", "")
  28. $FILETYPE = IniRead( $WINDOWSPATH & "\" & "DATA.INI", "INI", "FILETYPE", "JPEG")
  29.  
  30.  
  31. $msg = TrayGetMsg()
  32. Case $msg = 0
  33. Case $msg = $JPEG_ITEM
  34. IniWrite( $WINDOWSPATH & "\DATA.INI", "INI", "FILETYPE", "JPEG")
  35. Case $msg = $PNG_ITEM
  36. IniWrite( $WINDOWSPATH & "\DATA.INI", "INI", "FILETYPE", "PNG")
  37. Case $msg = $BMP_ITEM
  38. IniWrite( $WINDOWSPATH & "\DATA.INI", "INI", "FILETYPE", "BMP")
  39. Case $msg = $EXIT_ITEM
  40.  
  41.  
  42. Func DID_CLICK()
  43. $NUMBER = IniRead( $WINDOWSPATH & "\" & "DATA.INI", "INI", "NUMBER", "x")
  44. $FILETYPE = IniRead( $WINDOWSPATH & "\" & "DATA.INI", "INI", "FILETYPE", "JPEG")
  45. Send("{PRINTSCREEN}")
  46. Run( "mspaint.exe" )
  47. WinWaitActive("Untitled - Paint")
  48. Send("^v")
  49. WinClose("Untitled - Paint")
  50. WinWaitActive( "Paint")
  51. Send("s")
  52. WinWaitActive( "Save As" )
  53. Send($WINDOWSPATH & "\" & $NUMBER)
  54. If $FILETYPE = "JPEG" Then
  55. Send("{Enter}")
  56. Elseif $FILETYPE = "PNG" Then
  57. Send("{TAB}")
  58. Send("p")
  59. Send("{ENTER}")
  60. Elseif $FILETYPE = "BMP" Then
  61. Send("{TAB}")
  62. Send("{DOWN}")
  63. Send("{UP}")
  64. Send("{ENTER}")
  65. Send("{ENTER}")
  66. INIWrite( $WINDOWSPATH & "\DATA.INI", "INI", "NUMBER", $NUMBER + 1)
  67.  
  68.  
  69. Func CLOSE()
  70. Exit 0

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.