Poojan (Wagh) Blog

Requests for comment

Autohotkey transparency script

with 13 comments

I use WikidPad at work (and at home) to keep logs/notes on tasks that I’m doing (or want to do). One nice feature of WikidPad is that it has an “always on top” setting which keeps the WikidPad window on top while another window (behind it) is active.

I use this feature with my VNC session (most of my work is on Linux) so that I can copy/paste results and snippets. Unfortunately, a lot of time the result itself (due to its placement within the VNC session) is right behind the WikidPad window. It would be nice to have WikidPad be transparent.

Turns out, AutoHotkey already has this feature. The following script does the trick:

    #T::
    DetectHiddenWindows, on
    WinGet, curtrans, Transparent, A
    if ! curtrans
        curtrans = 255
    newtrans := curtrans - 64
    if newtrans > 0
    {
        WinSet, Transparent, %newtrans%, A

    }
    else
    {
        WinSet, Transparent, 255, A
        WinSet, Transparent, OFF, A
    }
    return

    #w::
    DetectHiddenWindows, on
    WinSet, TransColor, Black 128, A
    return

    #o::
    WinSet, Transparent, 255, A
    WinSet, Transparent, OFF, A
    return

    #g::  ; Press Win+G to show the current settings of the window under the mouse.
    MouseGetPos,,, MouseWin
    WinGet, Transparent, Transparent, ahk_id %MouseWin%
    WinGet, TransColor, TransColor, ahk_id %MouseWin%
    ToolTip Translucency:`t%Transparent%`nTransColor:`t%TransColor%
    return

Key codes:

<Win>+T: Increments transparency by 25% (with wrap-around)
<Win>+W: Set black color to be 50% transparent (also does click-through)
<Win>+O: Reset transparency settings

Here’s a screenshot of a partially transparent WikidPad hovering over a full-screen VNC session; Ion3 is my window manager:

Transparency example with WikidPad over VNC

Written by PoojanWagh

August 27th, 2008 at 11:49 pm

13 Responses to 'Autohotkey transparency script'

Subscribe to comments with RSS or TrackBack to 'Autohotkey transparency script'.

  1. its not working on my win7(professional) 32 bit..
    can u give me the script for my windows

    sunil

    4 Mar 11 at 6:20 am

  2. […] A quem interessar, o script original é este e o site do Autohotkey é este. Compatilhe este artigo […]

  3. […] è partito da questo script che usa un singolo hotkey per modificare la trasparenza del 25% ad ogni pressione e l’ha […]

  4. where do i copy and paste?

    Ethan

    13 Jan 12 at 7:17 pm

  5. @Ethan: copy and paste what?
    If you want transparency on the script, then install AutoHotkey, create a new script for AutoHotkey, copy the script from this web page, and paste it into your new script.
    You should probably read the AutoHotkey manual, too.

    PoojanWagh

    13 Jan 12 at 8:55 pm

  6. Nice. Thanks.

    I added the small RemoveToolTip script found in the AHK help for tooltip to make the tooltip die in 5 seconds. This adds 1 line to the win-G function and about four lines to the end of the script. Otherwise, the tooltip was persistent on my screen.

    Nice script – thankyou

    Kurt

    24 Feb 12 at 5:03 pm

  7. This is nice!

    @Kurt: thanks for the RemoveToolTip idea, I too had the tooltip stuck visible on the screen. I put the modified end of this transparency script here if someone needs it:

    .
    .
    ToolTip Translucency:`t%Transparent%`nTransColor:`t%TransColor%
    SetTimer, RemoveToolTip, 5000
    return

    RemoveToolTip:
    SetTimer, RemoveToolTip, Off
    ToolTip
    return

    snowman

    28 Feb 12 at 9:15 am

  8. Im new to programing but where do I run this script? It says wikipad isnt running anymore, i need this for a trace on my inkpad, unlike photoshop you cant change the opacity, so i need to change a window

    Jon

    16 Jun 12 at 1:05 am

  9. like how do i run the script , i put the script in the notepad cause when i ran hotkey it opened notepad soooo what do i do from here?

    Jon

    16 Jun 12 at 1:14 am

  10. Hi, I’ve test this but it’s not working with command line windows, any ideas?

    builder

    19 Nov 12 at 2:07 pm

  11. hi,
    thanks it worked i did mods on different keys for alpha levels for 25% was a li’le too glassy…i changed it -32 [12.5%] and it did wonders ,am new autoHotkey didnt know about it either thanks
    ganesh

    Ganesh

    8 Jan 13 at 5:23 am

  12. Thank you, worked well.

    Tilo

    9 Sep 17 at 10:58 am

  13. i am not getting tranparency help

    Paula Beatty

    29 May 18 at 3:32 pm

Leave a Reply