hot key in exe file

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
argiros
Newbie
Posts: 2
Joined: Wed Jun 09, 2004 12:38 pm

hot key in exe file

Post by argiros » Wed Jun 09, 2004 12:43 pm

Can you please answer my question:

When I compile a script to an .exe file how can I assign a hot key to this .exe;

Thank you

Argiros Thanasis

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jun 09, 2004 7:38 pm

You cannot assign a hot key to the exe, but you can assign a hot key to your macro.

When the macro is done., right click on the macro name, and left click on Properties. Go to the tab for HotKey, and fill in the blanks. Pu t acheck mark in the box to assign a hot key, and then choose your hot-key combination. Click on OK to save this.

I have no idea about priorities if your hotkey selection conflicts with another program. You will have to watch out for that , remember that many programs have hotkeys to activate options on their Main Menu and SubMenu bars, so the conflicts may not always be visible or easy to ID.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

McFrede

You may actually do this...

Post by McFrede » Wed Oct 13, 2004 8:20 am

In windows, right click on the .EXE file, choose the tab "shortcuts", and now you should have a field called "shortcut". Place your cursor there, and press the combination of buttons you would like to run the .EXE file. Simple as that I believe. As I am working on a danish version of windows XP, names of fields and tabs may not be correct.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Thu Oct 28, 2004 8:46 pm

Not sure if this "workaround" will help you. I have used it to successfully transfer a hotkeyed compiled exe from one computer to a scond one which does not have MS installed.

http://www.mjtnet.com/forum/viewtopic.p ... ht=hot+key
Last edited by Dorian (MJT support) on Fri Oct 29, 2004 1:26 pm, edited 1 time in total.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Oct 28, 2004 10:40 pm

this "workaround" :?: :?:

---------------------------------------------
Updated edit:
This can be ignored. When first posted, there was no link following the reference to a workaround. Horoscopes2000 has subsequently inserted a link to the "workaround". Thanks.....
Last edited by Bob Hansen on Fri Oct 29, 2004 9:32 pm, edited 3 times in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Oct 29, 2004 8:01 am

Ditto!

We need to think about what is happening here. A .exe is a set of instructions that will do something WHEN you run it. notepad.exe will present itself as a text editor and let you write some text in it WHEN you run it. calc.exe WHEN you run it will pop a calculator on the screen and let you do some basic math. When you close the .exe it ceases to exist in memory.

A script file is also something that WHEN Macro Scheduler is asked to run it will perform some instructions.

One way to start script files IN Macro Scheduler is by assigning a hot key to it. How does this work? Well there's a list of hotkeys matched to a list of scripts. Macro Scheduler WHILE it is running will keep checking to see if one of those hotkeys was pressed and if so RUN the macro. The script itself doesn't know anything about the hotkey.

If you exit Macro Scheduler there is nothing checking to see if a hotkey is pressed and so when you issue one nothing will happen.

So SOMETHING has to run continuously, checking for hotkeys pressed for them to work. Windows is always running. Windows also lets you assign hotkeys to shortcuts and will keep checking to see if you issued one.

So, the fact that .EXE versions of scripts can't magically spring to life when you issue a hotkey that was set up in Macro Scheduler that is now no longer running and probably on a completely different computer, in the same way that notepad.exe or calc.exe or any other .exe in the world can't just create itself without YOU starting it, is not a bug, or a design fault, or anything that needs a 'workaround'.

If you want to have a standalone .exe run when you issue a hotkey do what you have always been able to do in Windows and assign a hotkey to the shortcut. This is not a workaround because it is normal!

Of course, you could write a script that runs all the time and has a loop in it constantly checking for a certain key to be pressed. This script would then need to be run on startup and left running continuously because how else does it know when the key has been pressed? But this is wasteful of resources, clumsy and pointless when Windows ALREADY lets you assign hotkeys to shortcuts. So, workaround? How on earth is this a workaround?

I sometimes wonder if people really think we sit over a cauldron saying magic spells, or if they actually understand that we sit in front of computers writing software within the realms of possibility!
MJT Net Support
[email protected]

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Fri Oct 29, 2004 1:14 pm

Bob Hansen wrote: this "workaround" :?: :?:
What do you mean Bob? Not sure I understand you.

EDIT. :oops:
Ah. I see now. I didn't mean the term "workaroud" to offend anybody. All I really meant was I had a "clumsy solution", as I didn't want to be bold enough to claim it was a *good* solution. It seems I have stumbled on a word which suggests something is somehow faulty? Not being a programmer I was not aware that word had such connotations. I've always thought of "workaround" as a way of describing a not always ideal solution to a problem, like a "bodge" if you know what I mean.

MS is probably the best money I have ever spent on software, and in no way was I attempting to suggest it is buggy or faulty. I apologise if there ws a misunderstanding which caused any upset. MS is amazing, and i love ya all!!! I truly appreciate everything it does for me, and all the help I get in here. :D

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Oct 29, 2004 9:36 pm

Hello Horoscopes2000

See my edit, that follows your edit. I was not criticizing your "workaround", I just wanted to know what it was! No link there when I submitted originally.

And I would not suggest that anyone's answer was clumsy either. There are many ways to solve a problem, and if it works for you, then use it. I am sure that many of my own solutions could be improved upon.

Great thing about this forum is that I think most of us are non-judgmental, just trying to do things better, learning from each other.

Thanks for your suggestion.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Fri Oct 29, 2004 9:55 pm

Hi Bob,

Aaah, I see. I didn't know what you meant at all, and then when I read the post by support I thought both of you meant the same thing. It looks like they mistook you too.

I realised after everything was said and done that I hadn't actually pasted the link (burning candles at both ends too much recently), so went back and edited.

That solution seems to actually work, by the way. I have successfully used winzip or winrar to put everything in the right place and run on a third party machine.

Shel

Beyond hotkey and shortcut...

Post by Shel » Sun Nov 28, 2004 4:59 pm

Hello Horoscopes2000
All good staff about the use of hotkey and shortcut :idea: , but I have an exe. That I want to (run) based on a keyboard input of (W#T) I’ve been told I have to do a second Macro that’s a (listener) and it execute the main Macro, all I can figure out is it has something to do with making a keyboard recording.

Horoscopes2000, if you could help me I’d look like a star around here!!!

Thanks, Shel

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Mon Nov 29, 2004 4:27 am

Hi Shel,

Hmm, I must admit I don't have the first clue how to do that. It sounds like it would be very cumbersome in operation. That hotkey solution works, but it's only with traditional ctrl+ type hotkeys. If I think of a solution I'll be sure to let you know. Sometimes a lightbulb will go off in the middle of the night!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts