One of the
posts prompted me to talk about how I solved one problem using AutoHotKey.
In a local network, there is often a need to show your interlocutor what is happening on your screen during chatting.
The easiest way out is printscreen, mspaint, Save As, and then another transmission over the network using one of the available protocols, after which this file will be downloaded and opened.
Long and dreary.
When I first became acquainted with the capabilities of AutoHotKey, a thought began to take shape that the task of transferring a picture could be implemented more conveniently.
')
And this is how it was done:
An account was organized on the local network server with an apache, and a script was written on AutoHotKey.
;-------------------------------------------------------------------------------
; buf2link
;-------------------------------------------------------------------------------
; :
ServIP=192.168.1.1
FTPlogin=flogin
FTPpass=fpass
ftpdir=/var/www/buf/
HTTPlink=http://%ServIP%/buf/
;-------------------------------------------------------------------------------
;
NameFileTime = %A_Now%.jpg
; ( i_view32.exe)
RunWait, i_view32.exe /clippaste /convert=%NameFileTime%
;-------------------------------------------------------------------------------
;
FTPCommandFile = %A_ScriptDir%\FTPCommands.txt
; ftp
FileAppend,
(
open %ServIP%
%FTPlogin%
%FTPpass%
binary
cd %ftpdir%
put %NameFileTime%
quit
), %FTPCommandFile%
RunWait %comspec% /c ftp.exe -s:"%FTPCommandFile%"
FileDelete %FTPCommandFile%
;-------------------------------------------------------------------------------
clipboard = %HTTPlink%%NameFileTime%
;-------------------------------------------------------------------------------
FileDelete %NameFileTime%
;-------------------------------------------------------------------------------
MsgBox, 1,, `n`n ?
IfMsgBox Ok
Run %clipboard%
else
return
The script was compiled, placed in the buf2link folder along with the IrfanView viewer (i_view32.exe) and packaged into the unpacking archive itself for distribution to users.
How to use:
1 after the required image appeared in the clipboard (for example, after pressing Alt + PrtScr)
2 run buf2link.exe
(for example, by clicking on the button in the quick launch panel)
3 buf2link saves your image to a file, uploads it to an ftp server and saves a link to the clipboard that you can already communicate to the other party (what the message will be displayed)
Now, to transfer the image over the network, just press one button and double-click with the mouse! :)