Advertisement
Medianico

ScreenShot Capture Screen to file

Feb 23rd, 2024 (edited)
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; If you like this program donate a coffee to paypal d.marzano@libero.it
  2.  
  3. ;-https://www.irfanview.com/
  4. ;-https://www.autohotkey.com/board/topic/121619-screencaptureahk-broken-capturescreen-function-win-81-x64/  ;- see also user 'Linear Spoon'
  5. ;screenshots=%a_desktop%\SCREENSHOTS                ;- create folder
  6. ; Tasto F11 cattura schermo intero e salva file tipo "AA-data-ora.png"
  7. ; cambia le lettere "AA" a piacimento
  8.  
  9. screenshots=G:\_cattura                ;- create folder
  10.  
  11. ifnotexist,%screenshots%
  12.   filecreatedir,%screenshots%
  13. ;--  
  14. ;irfan=C:\Program Files\IrfanView\i_view64.exe
  15. irfan=g:\uty\irfanview462\i_view64.exe
  16. wa:=A_screenwidth,ha:=A_screenHeight,xx:=100
  17. return
  18. ;---------------------------------------------
  19. *~$!F2::
  20. F11::
  21. ;salva in altro drive\percorso
  22. ;aac=%screenshots%\%a_now%_screenshot.png
  23.  
  24. ;salva directory corrente
  25. ;e cambia il prefisso dei file es AA, BB, XX
  26. aac=BB_%a_now%_screenshot.png
  27. ;---
  28. x:=(wa*10)//xx ,y:=(ha*1)//xx,w:=(wa*50)//xx,h:=(ha*50)//xx          ;- x=10%   y=1%   width=50%   height=50%
  29. ;AA=/capture=2 /crop=(%x%,%y%,%w%,%h%) /aspectratio /convert=%aac%
  30. AA=/capture=1  /aspectratio /convert=%aac% ; Full screen
  31.  
  32. ifexist,%irfan%
  33.  {
  34.  runwait,%irfan% %AA%
  35.  run,%aac%
  36.  
  37. SoundPlay, %A_WinDir%\Media\chimes.wav
  38. Sleep, 500 ; ritardo minimo tra premere e rilascio
  39. SoundPlay, %A_WinDir%\Media\chimes.wav
  40.  
  41.  }
  42. return
  43. ;--------------
  44.  
  45. F1::
  46. ; SoundBeep, 400, 1000 ; frequenza hz, durata msec - fine programma
  47. SoundPlay, %A_WinDir%\Media\chimes.wav
  48. Sleep, 500 ; ritardo
  49. ExitApp
  50. return
  51.  
  52. F12::ESC
  53.  
  54. ;----------------------------------------------------------------------------------
  55. /*
  56. --- capture values:
  57. 0 = whole screen
  58. 1 = current monitor, where mouse is located
  59. 2 = foreground window
  60. 3 = foreground window - client area
  61. 4 = rectangle selection
  62. 5 = object selected with the mouse
  63. 6 = start in capture mode (can't be combined with other commandline options)
  64.  
  65. --- Advanced examples:
  66. i_view32.exe /capture=2 /convert=c:\test.jpg
  67. Capture foreground window and save result as file.
  68.  
  69. i_view32.exe /capture=2 /convert=c:\capture_$U(%d%m%Y_%H%M%S).jpg
  70. Capture foreground window and save result as file; the file name contains time stamp.
  71. */
  72. ;-----------------------------------------------------------------------------------
  73.  
  74. ;shift + F12 = exitapp
  75.  
  76. +F12::
  77. ; SoundBeep, 400, 1000 ; frequenza hz, durata msec - fine programma
  78. SoundPlay, %A_WinDir%\Media\chimes.wav
  79. Sleep, 500 ; ritardo
  80. ExitApp
  81. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement