Shortcut for calc.exe, making the shortcut work inside the programme [SOLVED]

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SenseElation
Posts: 4
Joined: 16 Feb 2018, 01:00

Shortcut for calc.exe, making the shortcut work inside the programme [SOLVED]

16 Mar 2018, 10:23

[Windows 10]
Hi, sorry for the long title. A bit hard to describe.
I don't know any scripting so please bear with me.

After snooping around on the forums and in the Help file I've found a nice little working script for opening calc.exe:

Code: Select all

NumpadDiv::
IfWinNotActive Kalkulator
Run calc.exe
return
I have IfWinNotActive to try tro make the key work in Calculator for dividing (and also not to open another instance of it). But right now it doesn't work as divide in the programme, when the script is running. Is there a way to do this?

Thank you!
Last edited by SenseElation on 18 Mar 2018, 05:02, edited 1 time in total.
Rohwedder
Posts: 7622
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Shortcut for calc.exe, making the shortcut work inside the programme

16 Mar 2018, 11:20

Hallo,
try:

Code: Select all

#If !WinActive("ahk_class CalcFrame")
NumpadDiv::
Run calc.exe
return
#If
SenseElation
Posts: 4
Joined: 16 Feb 2018, 01:00

Re: Shortcut for calc.exe, making the shortcut work inside the programme

18 Mar 2018, 04:56

Hi!
Thank you, but that unfortunately brings up another instance of Calc when it's already running.
What is the #if command at the end for?

Hey, so I worked it out! :D
With a little help from you I made some edits to my file and it worked out great!

Code: Select all

#IfWinNotActive Kalkulator
NumpadDiv::
Run calc.exe
return
#If
Danke schön!
Spoiler
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Shortcut for calc.exe, making the shortcut work inside the programme [SOLVED]

18 Mar 2018, 05:20

The second #f is the close context sensitivity for the hotkey that's it. It's not required because all there is in your script is one hotkey, but rohwedder assumed that you have more than that to add to the script in the future.
I am your average ahk newbie. Just.. a tat more cute. ;)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 323 guests