Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Autohotkey desktop shortcut


  • Please log in to reply
31 replies to this topic
michaelosm
  • Members
  • 16 posts
  • Last active: Aug 13 2010 10:28 PM
  • Joined: 28 Jul 2010
Hi

I am trying to create a desktop shortcut which when double-clicked executes a hotkey combination of CTRL-ALT-SHIFT-Z.
I hate having to use the keys every time hence why I wanted a shortcut. What’s the easiest way to do this in autohotkey?

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006
Why exactly do you need a shortcut when you can use AHK to do the job for you :?:

You did not post any code.
This may get you halfway there:
scriptText = [color=purple]msgbox`, execute CTRL-ALT-SHIFT-Z[/color]
fileAppend, % scriptText, % a_desktop "\HotKey Script.ahk"
Just have to change "msgbox`, execute CTRL-ALT-SHIFT-Z"
to the hotkey you want in the script.

hth

Posted Image

don't duplicate, iterate!


michaelosm
  • Members
  • 16 posts
  • Last active: Aug 13 2010 10:28 PM
  • Joined: 28 Jul 2010

Why exactly do you need a shortcut when you can use AHK to do the job for you :?:

You did not post any code.
This may get you halfway there:

scriptText = [color=purple]msgbox`, execute CTRL-ALT-SHIFT-Z[/color]
fileAppend, % scriptText, % a_desktop "\HotKey Script.ahk"
Just have to change "msgbox`, execute CTRL-ALT-SHIFT-Z"
to the hotkey you want in the script.

hth


I need a shortcut because I use Nexus dock to show/hide a dock from the desktop. But this can only be done using a hotkey. I want to click on an icon in the windows 7 taskbar to show/hide the dock, not the hotkey.

thanks

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006
Are you using Free or Ultimate?
I'm going to try the free version,
hopefully it has that feature built in..

Posted Image

don't duplicate, iterate!


michaelosm
  • Members
  • 16 posts
  • Last active: Aug 13 2010 10:28 PM
  • Joined: 28 Jul 2010
Winstep Xtreme is what I'm using. The free version is no different.

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006
hrm I cannot seem to find the "hide dock" option.
The only thing I see is 'Enable Auto Hide'
<!-- m -->http://i.imagehost.org/0415/PIC1.jpg<!-- m -->

Posted Image

don't duplicate, iterate!


michaelosm
  • Members
  • 16 posts
  • Last active: Aug 13 2010 10:28 PM
  • Joined: 28 Jul 2010
thats correct, you can have the dock auto-hide but the only way to show it is either to assign a hotkey to it or move the mouse to the edge of your screen to 'bump edge' the dock in to view. I want to have a win7 taskbar shortcut which shows/hides the dock. I thought I could use AH to do this?

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006
Ok for starters this test toggles show/hide of the dock ( tested on XPSP3 ).
f1:: ; Press F1 to execute toggle.
  winHide, % ( ( i:=!i ) ? "ahk_class ThunderRT5Form" : "" )
  winShow, % ( ( !i )	 ? "ahk_class ThunderRT5Form" : "" )
return
Give it a try and let me know if the dock hides and comes back per each alternate press of F1.
If all goes well, it should be as simple as removing the hotkey, return lines and then dragging the saved script to the w7 taskbar.

Let me know what happens.
BTW if theres a problem I can try it on w764 a little later.

Posted Image

don't duplicate, iterate!


michaelosm
  • Members
  • 16 posts
  • Last active: Aug 13 2010 10:28 PM
  • Joined: 28 Jul 2010
nothing happens. What is ThunderRT5Form?
Sorry, I am noob to all of this.

michaelosm
  • Members
  • 16 posts
  • Last active: Aug 13 2010 10:28 PM
  • Joined: 28 Jul 2010
got it, I see that it hides the dock. I thought it would slide the dock in to view like pressing the hotkey combo would. What I really wanted was AH to execute the hotkey combo alt ctrl shift z as if I were pressing the keys but from a shortcut instead...

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006
* reply to 'it does nothing'
hrm try this ( also works for me ) :
f1::
  winHide, % ( ( i:=!i ) ? "NxDock" : "" )
  winShow, % ( ( !i )	 ? "NxDock" : "" )
return

nothing happens. What is ThunderRT5Form?
Sorry, I am noob to all of this.

ThunderRT5Form is the class name for the dock.

If the above code fails,
you need to find out the window class name for the nexus dock on your system ( although it should be the same ).
Using Active Window Info that comes with AHK you can find out the class name ( for instance ahk_class ThunderRT5Form )

This should bring up Active Window Info:
run % a_programfiles "\AutoHotkey\AU3_Spy.exe"
Once it comes up, click somewhere on the dock,
You should see:
Posted Imagehtms

Posted Image

don't duplicate, iterate!


michaelosm
  • Members
  • 16 posts
  • Last active: Aug 13 2010 10:28 PM
  • Joined: 28 Jul 2010

* reply to 'it does nothing'
hrm try this ( also works for me ) :

f1::
  winHide, % ( ( i:=!i ) ? "NxDock" : "" )
  winShow, % ( ( !i )	 ? "NxDock" : "" )
return

nothing happens. What is ThunderRT5Form?
Sorry, I am noob to all of this.

ThunderRT5Form is the class name for the dock.

If the above code fails,
you need to find out the window class name for the nexus dock on your system ( although it should be the same ).
Using Active Window Info that comes with AHK you can find out the class name ( for instance ahk_class ThunderRT5Form )

This should bring up Active Window Info:
run % a_programfiles "\AutoHotkey\AU3_Spy.exe"
Once it comes up, click somewhere on the dock,
You should see:
Posted Imagehtms


this works, but please see my previous reply.

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006

got it, I see that it hides the dock. I thought it would slide the dock in to view like pressing the hotkey combo would. What I really wanted was AH to execute the hotkey combo alt ctrl shift z as if I were pressing the keys but from a shortcut instead...

When I press this combo, it does nothing to the dock :?:

Posted Image

don't duplicate, iterate!


michaelosm
  • Members
  • 16 posts
  • Last active: Aug 13 2010 10:28 PM
  • Joined: 28 Jul 2010
it's because I set the hotkey combo in the dock preferences :lol:

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006

it's because I set the hotkey combo in the dock preferences :lol:

Where exactly, theres a lot of options in there ;)..

Posted Image

don't duplicate, iterate!