Author Topic: AutoHotKey: Share your Scripts!  (Read 34465 times)

0 Members and 1 Guest are viewing this topic.

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
AutoHotKey: Share your Scripts!
« Reply #50 on: Sat, 07 January 2012, 17:40:07 »
For the functions you are saying do not work, all that is happening with the script is that it is taking your key press combination  and translating it to the related media key press that could be found on any keyboard claiming to have media keys.  It is up to iTunes to tell the OS that when media keys are pressed they should be forwarded on to iTunes.  I've never used iTunes so I have zero familiarity with it.  With Winamp it's a specific setting inside the Global Hotkeys screen.  On Windows XP there was a Control Panel that allowed you to fiddle with that stuff as well.  I have not found the same control panel in Win7.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline 1uckyNumb3r7

  • Posts: 32
AutoHotKey: Share your Scripts!
« Reply #51 on: Sun, 22 January 2012, 23:30:36 »
I have a question for the AHK vets on here....

I am running this line in a script because I am using a Model M and want to have a Windows key for some volume and media function scripts that need that key.

Code: [Select]
RControl::LWin

The key works like it is supposed to, so if I hit RControl+Up then the volume goes up.

My problem is that when I release the RControl after hitting Up then the start menu pops up and I have to hit RControl again in order to make it go away. Is there a way to make it act like a normal LWin key and not pop up on the release of RControl?

Offline slueth

  • Posts: 577
AutoHotKey: Share your Scripts!
« Reply #52 on: Sun, 22 January 2012, 23:34:37 »
i think you can get the windows key by hitting the shift and cntrl or some combo like that.

Offline 1uckyNumb3r7

  • Posts: 32
AutoHotKey: Share your Scripts!
« Reply #53 on: Sun, 22 January 2012, 23:59:25 »
Quote from: slueth;496578
i think you can get the windows key by hitting the shift and cntrl or some combo like that.


You might be thinking of Ctrl + Esc? It will bring up the start menu but that is it.

If I were to hit Ctrl+Esc+Up it wouldn't behave the same as Win+Up

Edit: I forgot to mention that if I plug in my other keyboard and try the Win+Up combo the volume goes up and the start menu doesn't pop up.

Edit 2: I found a solution, but it does not involve the use of AutoHotKey unfortunately. http://www.jonlee.ca/remap-capslock-the-most-useless-key/

Quote
How to remap Caps Lock to another key
For Linux users (on an X environment like KDE, Gnome), it’s pretty easy to remap keys using the xmodmap command.

For Windows users, there are programs that will remap keys for you but if you’re not afraid to tinker with your registry, you can do this manually and it only requires adding one registry value:

    Go to Start->Run and type in ‘regedit’ to open the registry editor.
    Navigate to:

        HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
        Note: Keyboard Layout, not Keyboard Layouts!

    Go to Edit->New->Binary Value and name it ‘Scancode Map’
    Now double-click and edit the value to the following, replacing ## ## with the scan code of the key you wish to map caps lock to.

        00 00 00 00 00 00 00 00 02 00 00 00 ## ## 3a 00 00 00 00 00

    The scan code for Windows Key is 5B E0, Esc is 01 00, Ctrl is 1D 00. Full list of scan codes and a more detailed tutorial is here.
    Reboot your computer and say goodbye to caps lock!
« Last Edit: Mon, 23 January 2012, 09:34:02 by 1uckyNumb3r7 »

Offline Hamblet

  • Posts: 159
AutoHotKey: Share your Scripts!
« Reply #54 on: Mon, 23 January 2012, 00:30:20 »
Quote from: 1uckyNumb3r7;496577
...My problem is that when I release the RControl after hitting Up then the start menu pops up and I have to hit RControl again in order to make it go away. Is there a way to make it act like a normal LWin key and not pop up on the release of RControl?


Try this code, It works fine with me (I am AHK_Basic and Vista 32)
Hotkey:: Sendplay {LWin}{Up}

Offline Shogunner

  • Posts: 58
AutoHotKey: Share your Scripts!
« Reply #55 on: Tue, 24 January 2012, 21:32:30 »
Man.. respect you guys.

I've been trying to do a script that does what I want for the past few hours and it's been nothing but frustration. I just ended up using my Belkin n52te to control my media player. :P

Offline guilleguillaume

  • Posts: 694
AutoHotKey: Share your Scripts!
« Reply #56 on: Thu, 26 January 2012, 16:22:15 »
I ended up using Ripster's code from the first page since mine was causing some problems, very useful.


Quote
; Caps Lock becomes Ctrl, Win+LShift becomes Caps Lock
CapsLock::Ctrl
#Lshift::Capslock

Anyone knows how can I learn wich keycode send each key of the keyboard? I want to remap 5 of the Japanese keys I have left that right now don't have any use.
« Last Edit: Thu, 26 January 2012, 19:18:47 by guilleguillaume »

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
AutoHotKey: Share your Scripts!
« Reply #57 on: Thu, 26 January 2012, 16:25:28 »
PassMark KeyboardTest might be able to pull it off.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline pyro

  • Posts: 177
AutoHotKey: Share your Scripts!
« Reply #58 on: Thu, 26 January 2012, 16:36:22 »
Right click on the Autohotkey icon in the notification area
click Open
an Autohotkey window will open, click 'view' >> 'key history and script info' in the menu bar
press any series of keys and then hit F5

Offline no_mates

  • Posts: 4
AutoHotKey: Share your Scripts!
« Reply #59 on: Sat, 18 February 2012, 18:26:11 »
Can some someone please help I need to map the side button (#7) on my CM Spawn to the shift key for BF3.  There appears to be a bug with the Spawn where some modifier keys don't work even though the software say's they're mapped?

Offline shogrran

  • Posts: 264
AutoHotKey: Share your Scripts!
« Reply #60 on: Sun, 19 February 2012, 09:43:04 »
EDIT: Comment removed. I get it now thankee!
« Last Edit: Sun, 19 February 2012, 10:41:51 by shogrran »
Razer Blackwidow Elite
CMStorm Quickfire Rapid
[SIGPIC][/SIGPIC]

Offline BiNiaRiS

  • Posts: 486
Re: AutoHotKey: Share your Scripts!
« Reply #61 on: Sat, 29 June 2013, 04:28:10 »
Scroll your mouse wheel over your windows taskbar and change your volume!

Code: [Select]
#If MouseIsOver("ahk_class Shell_TrayWnd")
WheelUp::Send {Volume_Up}
WheelDown::Send {Volume_Down}

MouseIsOver(WinTitle)
{
    MouseGetPos,,, Win
    return WinExist(WinTitle . " ahk_id " . Win)
}

Necroing the **** out of this thread to post a fixed version of this. Looks like no matter what, semicolons cannot be used for anything but comments. I couldn't get this to work until i replaced all the " with "

Running this on Win8 64 bit with no issues. Best script ever :D

Check out my sales thread.

KMAC 2 w/ErgoClears
KBC w/Reds and Cherry doubleshots in imsto\'s case
G80-1800HAU w/ErgoClears
Realforce 87UB 55g
KMAC Titanium/Winkeyless (in the mail)

Offline The_Beast

  • * Maker
  • Posts: 3964
  • Location: Wisconsin
  • I like wood ಠ_๏
Re: AutoHotKey: Share your Scripts!
« Reply #62 on: Sat, 29 June 2013, 04:35:11 »
Not a bad thread to necro

Code: [Select]
;; Auto-Reload If Changes Are Made
{
SetTimer,UPDATEDSCRIPT,1000

UPDATEDSCRIPT:
FileGetAttrib,attribs,%A_ScriptFullPath%
IfInString,attribs,A
{
FileSetAttrib,-A,%A_ScriptFullPath%
SplashTextOn,,,Updated script,
Sleep,500
Reload
}
Return
}

Capslock::
Gui, 99:+ToolWindow
Gui, 99:Show, x-1 y-1 +NoActivate, Dummy IJKL to Arrow Keys
Keywait, Capslock
If A_ThisHotkey != Capslock
   Gui, 99:Destroy
else Gui, 99:Show, x-1 y-1 +NoActivate, Dummy IJKL to Arrow Keys +CapsToCancel
return
#IfWinExist, Dummy IJKL to Arrow Keys +CapsToCancel
Capslock::return
CapsLock Up::Gui, 99:Destroy
#IfWinExist, Dummy IJKL to Arrow Keys
w::Up
a::Left
s::Down
d::Right
#IfWinExist

The top of the code is a simple updater. If you save an edit while the script is running, it autoupdates

The bottom is something to make the caps lock a 2nd layer. The cool thing about it is that if you press the caps lock, it locks the layer in. If you hold the caps lock then it doesn't lock and once you release it, it returns to the first layer


I didn't write either of these, but they are cool enough to share.
Vendor Status: Sadly, not taking any orders/pre-orders at this time

Vendor Quick Links: | Vendor Forum | Hardwood Wrist Rests | Hardwood 60% Cases | Customer Gallery | Giveaway |

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: AutoHotKey: Share your Scripts!
« Reply #63 on: Sat, 29 June 2013, 06:01:51 »
Anyone have any idea how to make the sleep button on my windows media center remote do alt+f4 instead of sleep?

Offline BiNiaRiS

  • Posts: 486
Re: AutoHotKey: Share your Scripts!
« Reply #64 on: Sat, 29 June 2013, 12:38:19 »
Anyone have any idea how to make the sleep button on my windows media center remote do alt+f4 instead of sleep?

I wouldn't even have the slightest clue. I'd be willing to bet you can't remap that button though. But if it had a scancode attached you'd be good to go.
Check out my sales thread.

KMAC 2 w/ErgoClears
KBC w/Reds and Cherry doubleshots in imsto\'s case
G80-1800HAU w/ErgoClears
Realforce 87UB 55g
KMAC Titanium/Winkeyless (in the mail)

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: AutoHotKey: Share your Scripts!
« Reply #65 on: Sat, 29 June 2013, 17:36:09 »
Anyone have any idea how to make the sleep button on my windows media center remote do alt+f4 instead of sleep?

I wouldn't even have the slightest clue. I'd be willing to bet you can't remap that button though. But if it had a scancode attached you'd be good to go.
it should have scamcode just like play pause or any of those other special keys. How would I figure it out? Would aqua key test do?

Offline Topre

  • Posts: 149
Re: AutoHotKey: Share your Scripts!
« Reply #66 on: Sat, 29 June 2013, 17:52:37 »
Anyone have any idea how to make the sleep button on my windows media center remote do alt+f4 instead of sleep?

I wouldn't even have the slightest clue. I'd be willing to bet you can't remap that button though. But if it had a scancode attached you'd be good to go.
it should have scamcode just like play pause or any of those other special keys. How would I figure it out? Would aqua key test do?

Open the Autohotkey script by right clicking it on the taskbar then click Ctrl+K or go under View and click the option "Key history and script info."

Offline TheProfosist

  • Posts: 3671
  • Location: Wisconsin, USA
  • Custom Layouts Only!
Re: AutoHotKey: Share your Scripts!
« Reply #67 on: Sat, 29 June 2013, 22:23:42 »
Anyone have any idea how to make the sleep button on my windows media center remote do alt+f4 instead of sleep?

I wouldn't even have the slightest clue. I'd be willing to bet you can't remap that button though. But if it had a scancode attached you'd be good to go.
it should have scamcode just like play pause or any of those other special keys. How would I figure it out? Would aqua key test do?

Open the Autohotkey script by right clicking it on the taskbar then click Ctrl+K or go under View and click the option "Key history and script info."

alright ill get AutoHotkey on it and try it out i think i should probably disable sleep on the system temporarily as well so it doesnt enter sleep when i hit if you know what I mean.

Offline The_Beast

  • * Maker
  • Posts: 3964
  • Location: Wisconsin
  • I like wood ಠ_๏
Re: AutoHotKey: Share your Scripts!
« Reply #68 on: Sat, 29 June 2013, 22:37:22 »
Code: [Select]
f1::
Run, firefox.exe http://geekhack.org/index.php?action=pm
return

f2::
Run, firefox.exe http://geekhack.org/index.php?topic=38471.0
return


You should try this script TheProfosist. They're direct links to your PMs and to the GB thread. Hope this halps!
Vendor Status: Sadly, not taking any orders/pre-orders at this time

Vendor Quick Links: | Vendor Forum | Hardwood Wrist Rests | Hardwood 60% Cases | Customer Gallery | Giveaway |

Offline laffindude

  • Posts: 1521
  • ( ̽ ¬ ˳¬)
Re: AutoHotKey: Share your Scripts!
« Reply #69 on: Sun, 30 June 2013, 00:53:15 »
Scroll your mouse wheel over your windows taskbar and change your volume!

Code: [Select]
#If MouseIsOver("ahk_class Shell_TrayWnd")
WheelUp::Send {Volume_Up}
WheelDown::Send {Volume_Down}

MouseIsOver(WinTitle)
{
    MouseGetPos,,, Win
    return WinExist(WinTitle . " ahk_id " . Win)
}

Necroing the **** out of this thread to post a fixed version of this. Looks like no matter what, semicolons cannot be used for anything but comments. I couldn't get this to work until i replaced all the " with "

Running this on Win8 64 bit with no issues. Best script ever :D
you need an escape char for semi colon. `; will work. (that's a grave accent).

Offline alrgeez

  • Posts: 20
Re: AutoHotKey: Share your Scripts!
« Reply #70 on: Mon, 11 November 2013, 16:56:56 »
can someone help me with a script? would like alt+wheel up = volume up, alt+wheel down = volume down.

need to be able to control master volume control while gaming with my headphones.
i<3myKB

Offline Neal

  • Posts: 301
  • Location: The Netherlands
  • Skype: iNewbcake
Re: AutoHotKey: Share your Scripts!
« Reply #71 on: Mon, 11 November 2013, 17:34:57 »
can someone help me with a script? would like alt+wheel up = volume up, alt+wheel down = volume down.

need to be able to control master volume control while gaming with my headphones.
I'm pretty noobish at AHK, but this will do what you want:
Code: [Select]
LAlt & WheelUp::
SoundSet +1
Return

LAlt & WheelDown::
Soundset -1
Return

This is a script a friend made, it allows you to resize windows and puts them in a corner of the screen if you want to.
As you can see I use it for some random things. Mainly setting windows to  1920x1080, I use 2560x1440 res and I like to have most windows at 1920x1080
Code: [Select]
RCtrl & F5::
 ResizeWin(773,567,1)
return

RCtrl & F6::
 ResizeWin(720,480,1)
return

RCtrl & F7::
 ResizeWin(1280,720,1)
return

RCtrl & F8::
 ResizeWin(1920,1080,1)
return


ResizeWin(CW=0,CH=0,SnapToCorner=0)
{
WinGetPos,X,Y,W,H,A
If %CW% = 0
  CW := W
  If %CH% = 0
  CH := H
  If SnapToCorner = 1
  {
  CX := A_ScreenWidth-CW
  CY := A_ScreenHeight-CH
  }
  Else If SnapToCorner = 2
  {
CX := 62
CY := A_ScreenHeight-CH
  }
  Else
  {
  CX := X
  CY := Y
}
 

  WinMove,A,,%CX%,%CY%,%CW%,%CH%
}
« Last Edit: Mon, 11 November 2013, 17:38:56 by Neal »

Offline C5Allroad

  • Formerly HUNTERANGEL121
  • Posts: 1235
  • Location: Miami, FL
  • Watch out, I post when half asleep.
Re: AutoHotKey: Share your Scripts!
« Reply #72 on: Mon, 11 November 2013, 18:29:39 »
Media keys on my shine 3.

Code: [Select]
SC121::Media_Stop
sc16b::Media_Prev
sc16c::Media_Play_Pause
sc132::Media_Next

Offline kolonelkadat

  • Posts: 180
  • Location: the vicinity of an area adjacent to a location
    • Force Project X
Re: AutoHotKey: Share your Scripts!
« Reply #73 on: Mon, 11 November 2013, 21:00:38 »
Anyone have any idea how to make the sleep button on my windows media center remote do alt+f4 instead of sleep?

I no longer have that button, but iirc when I had it, I had to disable it in the control panel - maybe under power options - in order to keep the computer from sleeping. It seemed to send the sleep command before the key press would get picked up by AHK or whatever I was using.
"Obviously, windows are central to Windows. But what is a window?"

Offline alrgeez

  • Posts: 20
Re: AutoHotKey: Share your Scripts!
« Reply #74 on: Tue, 12 November 2013, 14:24:49 »
I'm pretty noobish at AHK, but this will do what you want:
Code: [Select]
LAlt & WheelUp::
SoundSet +1
Return

LAlt & WheelDown::
Soundset -1
Return

thanks Neal! it worked awesome but it ended up cycling through my weapons in game. so i changed the wheel up/down to the arrow keys.

i<3myKB

Offline Pacifist

  • Report me *again* if there are gifs in my sig
  • * Elevated Elder
  • Posts: 3599
  • Location: Cali
  • on hiatus
Re: AutoHotKey: Share your Scripts!
« Reply #75 on: Wed, 27 November 2013, 21:16:18 »
Does anyone know the ahk code for my keycool 84's fn layer

specifically F1(which opens computer)
F2---google.com
F3 calculator
F4 music
?

the aquakeytest windows code is
182(0XB6)E
172(0XAC)E
183(0XB7)E
181(0XB5)E

thanks

Offline dustinhxc

  • * Exalted Elder
  • Posts: 6739
  • Location: MN
  • IV
    • Gray Designs
Re: AutoHotKey: Share your Scripts!
« Reply #76 on: Wed, 27 November 2013, 22:02:52 »
RAlt::RCtrl or whatever it is lol I'm on my phone. I use right alt as control :-)

Offline atlas3686

  • HHKB Elite
  • * Esteemed Elder
  • Posts: 2342
  • Location: South Africa
  • Preacher at the church of Thorpe
Re: AutoHotKey: Share your Scripts!
« Reply #77 on: Thu, 28 November 2013, 00:57:12 »
Put this together, it makes alt+F2 open the selected file in Photoshop.

Quote
!F2::

ClipSaved := ClipboardAll

Clipboard =

ValidFiletypes = jpg png gif jpeg bmp tif pdf

Send ^c

ClipWait

FullPath := Clipboard



Loop, parse, FullPath, `n, `r

{

    IfNotExist, %A_Loopfield%

        continue

    SplitPath, A_Loopfield ,,, OutExt,

    IfInString, ValidFiletypes, %OutExt%

        run, photoshop.exe %A_LoopField%

}

Clipboard := ClipSaved

OutExt =

ClipSaved =

return   

Offline Senbei

  • Posts: 5
Re: AutoHotKey: Share your Scripts!
« Reply #78 on: Fri, 29 November 2013, 07:22:29 »
Hello folks,
my script is for using AltGr _instead_ of the Fn keys on my 60% Filco Minila.
(I would like, eventually, to replace the small space bar with a bigger one, thus I won't have the Fn anymore)
Code: [Select]
SendMode Input

; function keys
*<^>!SC002:: Send {Blind}{RAlt up}{F1}{RAlt down}
*<^>!SC003:: Send {Blind}{RAlt up}{F2}{RAlt down}
*<^>!SC004:: Send {Blind}{RAlt up}{F3}{RAlt down}
*<^>!SC005:: Send {Blind}{RAlt up}{F4}{RAlt down}
*<^>!SC006:: Send {Blind}{RAlt up}{F5}{RAlt down}
*<^>!SC007:: Send {Blind}{RAlt up}{F6}{RAlt down}
*<^>!SC008:: Send {Blind}{RAlt up}{F7}{RAlt down}
*<^>!SC009:: Send {Blind}{RAlt up}{F8}{RAlt down}
*<^>!SC00A:: Send {Blind}{RAlt up}{F9}{RAlt down}
*<^>!SC00B:: Send {Blind}{RAlt up}{F10}{RAlt down}
*<^>!SC00C:: Send {Blind}{RAlt up}{F11}{RAlt down}
*<^>!SC00D:: Send {Blind}{RAlt up}{F12}{RAlt down}
*<^>!SC02B:: Send {Blind}{RAlt up}{PrintScreen}{RAlt down}
*<^>!SC00E:: Send {Blind}{RAlt up}{ScrollLock}{RAlt down}
*<^>!SC001::
Send {Blind}{RAlt up}
GetKeyState, state, Ctrl
if state = D
Send {Blind}{CtrlBreak}
else
Send {Blind}{Pause}
Send {Blind}{RAlt down}
return

; cursor block
*<^>!Up:: Send {Blind}{RAlt up}{PgUp}{RAlt down}
*<^>!Down:: Send {Blind}{RAlt up}{PgDn}{RAlt down}
*<^>!Left:: Send {Blind}{RAlt up}{Home}{RAlt down}
*<^>!Right:: Send {Blind}{RAlt up}{End}{RAlt down}
*<^>!Del:: Send {Blind}{RAlt up}{Ins}{RAlt down}

; tilde on dot
*<^>!SC034:: Send {Blind}{RAlt up}{SC029}{RAlt down}

Minila [brown]

Offline dustinhxc

  • * Exalted Elder
  • Posts: 6739
  • Location: MN
  • IV
    • Gray Designs
Re: AutoHotKey: Share your Scripts!
« Reply #79 on: Sat, 30 November 2013, 13:09:20 »
Put this together, it makes alt+F2 open the selected file in Photoshop.

Quote
!F2::

ClipSaved := ClipboardAll

Clipboard =

ValidFiletypes = jpg png gif jpeg bmp tif pdf

Send ^c

ClipWait

FullPath := Clipboard



Loop, parse, FullPath, `n, `r

{

    IfNotExist, %A_Loopfield%

        continue

    SplitPath, A_Loopfield ,,, OutExt,

    IfInString, ValidFiletypes, %OutExt%

        run, photoshop.exe %A_LoopField%

}

Clipboard := ClipSaved

OutExt =

ClipSaved =

return   

Now that's a cool idea!!!

Offline atlas3686

  • HHKB Elite
  • * Esteemed Elder
  • Posts: 2342
  • Location: South Africa
  • Preacher at the church of Thorpe
Re: AutoHotKey: Share your Scripts!
« Reply #80 on: Tue, 03 December 2013, 02:16:56 »
Thanks ,I right click, open with, so often that it just makes so much sense. Need to figure out how to do the same thing on my Macbook now.

Offline dustinhxc

  • * Exalted Elder
  • Posts: 6739
  • Location: MN
  • IV
    • Gray Designs
Re: AutoHotKey: Share your Scripts!
« Reply #81 on: Tue, 03 December 2013, 02:55:22 »
Any way to auto load the program at start up? Thanks !

Offline CeeSA

  • Posts: 341
  • Location: Germany
Re: AutoHotKey: Share your Scripts!
« Reply #82 on: Tue, 03 December 2013, 07:27:45 »
do you mean in windows? A Link in "Autostart" could be the solution....

Offline atlas3686

  • HHKB Elite
  • * Esteemed Elder
  • Posts: 2342
  • Location: South Africa
  • Preacher at the church of Thorpe
Re: AutoHotKey: Share your Scripts!
« Reply #83 on: Tue, 03 December 2013, 08:21:44 »
Any way to auto load the program at start up? Thanks !

Yup I have done it, there is a little program that comes with Autohotkey that turns your script into an exe then you just set that exe to run at startup.

Offline thegagne

  • Posts: 69
  • Location: United States
Re: AutoHotKey: Share your Scripts!
« Reply #84 on: Tue, 03 December 2013, 08:36:25 »
I need some suggestions on what to do with the 24 Fkeys on my Cherry 8113. :rolleyes:

Maybe changing audio output device?
Maybe speed up / slow down case fans?
Maybe League of Legends macro to buy champ-specific starting items?
That accounts for maybe 4...
What else?

Offline dustinhxc

  • * Exalted Elder
  • Posts: 6739
  • Location: MN
  • IV
    • Gray Designs
Re: AutoHotKey: Share your Scripts!
« Reply #85 on: Tue, 03 December 2013, 10:04:27 »
Any way to auto load the program at start up? Thanks !

Yup I have done it, there is a little program that comes with Autohotkey that turns your script into an exe then you just set that exe to run at startup.

Thank you very much! I use quick start.

Offline Neo.X

  • Posts: 341
  • Location: Mississauga, CA
Re: AutoHotKey: Share your Scripts!
« Reply #86 on: Tue, 03 December 2013, 13:15:34 »
Mine is very simple, Press a key to hide the active browser window, save my *** when boss come by.  ;)


!`::
  DetectHiddenWindows, on


     if WinExist("ahk_class IEFrame")
        {
               WinHide
         }

  DetectHiddenWindows, off
  return

   

!1::

     DetectHiddenWindows, on
    if WinExist("ahk_class IEFrame")
        {
               WinShow
         }
     DetectHiddenWindows, off

  return

All those keyboards will be lost in time....

Offline Frenir

  • HHKB Viking
  • Posts: 597
  • Location: Danmörk
Re: AutoHotKey: Share your Scripts!
« Reply #87 on: Wed, 25 June 2014, 08:39:07 »
I made this simple script for HHKB users in Nordic countries. It adds backslash and Less/Greater than symbols.
Code: [Select]
; --------------------------------------------------------------------
; Nordic HHKB Function - Less/Greater Than "<" ">"

; Left Alt + Z = "<"
!z::
{
SendInput {<}
}
return

; Left Alt + Shift + Z = ">"
+!z::
{
SendInput {>}
}
return

; --------------------------------------------------------------------
; Nordic HHKB Function - Backslash "\"

; Right Alt + Z = "\"
<^>!z::
{
SendInput {\}
}
return
Also, sorry for necro - I just wanted to share in case someone would find it useful.

Offline lakiozoon

  • Posts: 74
Re: AutoHotKey: Share your Scripts!
« Reply #88 on: Mon, 14 July 2014, 12:12:35 »
Anyone with a script that remaps keys while scroll-lock is on?
I'dd like to remap jkl area as a numpad while using scroll-lock.

Various scripts i've dug up googling don't work properly:(

Offline Neo.X

  • Posts: 341
  • Location: Mississauga, CA
Re: AutoHotKey: Share your Scripts!
« Reply #89 on: Mon, 14 July 2014, 13:37:56 »
What I am using now for number pad replacement.

!j::Send 1
!k::Send 2
!l::Send 3h
!u::Send 4
!i::Send 5
!o::Send 6
!7::Send 7
!8::Send 8
!9::Send 9
!m::Send 0
!.::Send .
All those keyboards will be lost in time....

Offline lakiozoon

  • Posts: 74
Re: AutoHotKey: Share your Scripts!
« Reply #90 on: Mon, 14 July 2014, 16:41:20 »
That one will come in handy, thanks!
I would like to have a workaround with scroll lock tho, all solutions i've tried produced errors of some kind.

Again, thanks for the effort.

Offline s0hei

  • Posts: 1
Re: AutoHotKey: Share your Scripts!
« Reply #91 on: Wed, 16 July 2014, 11:11:43 »
does anyone have a script for changing capslock -> fn? sorry for the stupid question

Offline Phenix

  • Posts: 591
  • Location: Germany
Re: AutoHotKey: Share your Scripts!
« Reply #92 on: Sat, 02 January 2016, 04:01:59 »
rarher use Foobar2000 for music and audiobooks than winamp.Way more customizable
Winter is coming.

Offline Coreda

  • Posts: 776
Re: AutoHotKey: Share your Scripts!
« Reply #93 on: Sat, 02 January 2016, 04:19:14 »
I keep a bunch in a collective mega-script.

A few examples (stripped of the standard top-of-script stuff like #NoEnv, etc) :

Auto-expand the Volume mixer panel window (credit: GeekDude):

More
Code: [Select]
Title = ahk_class #32770 ahk_exe sndvol.exe

Loop
{
    ; ToolTip, Searching
    WinWait, %Title%
    ; ToolTip, Found
    Winmove, %Title%,,,,900,
    WinWaitClose, %Title%
}


Minimize windows by middle-clicking on their titlebar (once you try it you'll never go back, source):

More
Code: [Select]
#If MouseIsOverTitlebar()
MButton::WinMinimize
+MButton::WinClose

MouseIsOverTitlebar() {
    static WM_NCHITTEST := 0x84, HTCAPTION := 2
    CoordMode Mouse, Screen
    MouseGetPos x, y, w
    if WinExist("ahk_class Shell_TrayWnd ahk_id " w)  ; Exclude taskbar.
        return false
    SendMessage WM_NCHITTEST,, x | (y << 16),, ahk_id %w%
    WinExist("ahk_id " w)  ; Set Last Found Window for convenience.
    return ErrorLevel = HTCAPTION
}


Send clipboard to the command prompt / PowerShell using Ctrl+V:

More
Code: [Select]
#IfWinActive ahk_class ConsoleWindowClass
^V::
SendInput {Raw}%clipboard%
return
#IfWinActive


Paste clipboard contents as plaintext in Wordpad using Ctrl+Shift+V (source):

More
Code: [Select]
#IfWinActive, ahk_class WordPadClass            ; WordPad
^+v::
Clip0 = %ClipBoardAll%
ClipBoard = %ClipBoard% ; Convert to plain text
Send ^v
Sleep 1000
ClipBoard = %Clip0%
VarSetCapacity(Clip0, 0) ; Free memory
Return
« Last Edit: Sat, 02 January 2016, 04:20:45 by Coreda »

Offline Lunatique

  • Posts: 292
  • Writer, Composer, Artist, Photographer, Gamer
Re: AutoHotKey: Share your Scripts!
« Reply #94 on: Sat, 09 January 2016, 04:02:38 »
For those of you who experience stability issues with AHK and don't need complex scripts, a much more stable and intuitive alternative is TouchCursor (although it is much simpler). But if TouchCursor can do all the things you want already, then definitely use it over AHK.

Offline Questengine

  • Posts: 26
    • Heroglyphix Nonogram Logic Puzzles
Re: AutoHotKey: Share your Scripts!
« Reply #95 on: Thu, 26 May 2016, 12:01:15 »
Here's a couple cool ones for coders. 

Type an "if" condition, like "somevar = 2" then hit alt-i and it builds an if statement around that, comments the condition after the closing brace, and puts the cursor in the body of the "if" after a tab

e.g. 
type: "somevar = true"
hit alt-i
get:
Code: [Select]
if(somevar=true){//

}//end if--somevar=true
And then alt-e does the same thing but for an if/else statement

Code: [Select]
;;do "if"
!i::
;;save what's currently on the clipboard
varClipSaved :=ClipboardAll
Sleep, 133
Send {Shift down}{Home}{Shift up}^c
Sleep, 133
Send if`(
Send %Clipboard%
Send `){{}{/ 2}{Enter 2}{}}{End}{/ 2}end if--
Send %Clipboard%
Send {Up }{End}{Tab}
;;restore what was originally on the clipboard
Clipboard := varClipSaved
;;empty that temp clipboard variable, to free that memory (in case you had a lot of crap there)
varClipSaved := 
return


;;do "if/else",
!e::
;;save what's currently on the clipboard
varClipSaved :=ClipboardAll
Sleep, 133
Send {Shift down}{Home}{Shift up}^c
  Sleep, 133
Send if`(
Send %Clipboard%
Send `){{}{/ 2}{Enter 2}{}}{End}{/ 2}end if--
Send %Clipboard%
Send {Enter}else{{}{Enter}{Tab}{Enter}{}}{/ 2}end else--
Send %Clipboard%
Send {Home}{Up 4}{Tab}
;;restore what was originally on the clipboard
Clipboard := varClipSaved
;;empty that temp clipboard variable, to free that memory (in case you had a lot of crap there)
varClipSaved := 
return

And a couple expansions that are obvious, but you probably aren't using.  Why type 6 characters when you can type 2?
Code: [Select]
::fff::function   
::sss::select * from
::pv::private
::pb::public
::pt::protected

And a couple just for Unity and/or 3D programming:
Code: [Select]

::vv::Vector3
::vz::Vector3.zero
::vd::Vector3.Distance(){Left}
::qqq::Quaternion   
::gg::gameObject  ;; gg doesn't come up too often naturally
::pp::transform.position  ;;similarly, pp is pretty safe
::rrt::transform.rotation  ;; tr, rt, and rot, are to common for this, so rrt has to suffice.