buf2link - Share images on a local network

    One of the posts encouraged me to talk about how I solved one problem using AutoHotKey.

    In the local network, it is often necessary during a chat in a chat to show the interlocutor what is happening on your screen.
    The easiest way out is printscreen, mspaint, Save As, and then another transfer over the network with 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, the idea began to form that the task of transferring pictures could be implemented more conveniently.

    And here is how it was done:
    An account was organized on the server of the local network with 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, put into the buf2link folder together with the IrfanView viewer (i_view32.exe) and packed into a self-extracting archive for distribution to users.

    How to use:
    1 after the desired image appears on 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 will save your image to a file, upload it to the ftp server and save to the clipboard a link that can already be communicated to the interlocutor (of which a message will be

    displayed ) Now to transfer the image over the network, just click one button and double-click it! :)

    Also popular now: