Jump to content

HotKeySet Dynamic


Recommended Posts

Hi,

I Try to use the same Shortcut in different programs. For this case I create following:

HotKeySet("^a", "HotKeyManagerFunc(""^a"")")

Func HotKeyManagerFunc()

Dim $ActivePrograms

$ActivePrograms = GetActivePrograms()

For $i=1 to $ActivePrograms[0][0] Step 1

If WinActive($ActivePrograms[$i][1]) Then

Dim $ShortCutInProgram

$ShortCutInProgram = IniRead("settings.ini", $ActivePrograms[$i][1], $ShortCut, "")

If Not $ShortCutInProgram = "" Then

Call ($ShortCutInProgram)

EndIf

EndIf

Next

EndFunc

The Function should call the different functions for the programs, which stored in a extern INI-File.

If I run this script I get an error by HotKeySet. Obviously HotKeySet dont provide parameters for the calling function. How can I realize my script in this way without parameters in HotKeySet-Function-Call?

Bye Crash

Link to comment
Share on other sites

The Function should call the different functions for the programs, which stored in a extern INI-File.

If I run this script I get an error by HotKeySet. Obviously HotKeySet dont provide parameters for the calling function. How can I realize my script in this way without parameters in HotKeySet-Function-Call?

Hi Crash-

Could you provide an example of what would be in the ini file? I'm a bit confused and that might help. Also, is it correct to say that if, for example, Word is not running, that this program would simply launch Word? Or would it launch Word with a specific command line? I'm not clear on this... Thanks.

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

My Ini-file is very simple:

[iNI-FILE]

[ACTIVE PROGRAMS]

Prog1=Programm 1

Prog2=Programm 2

[Programm 2]

^a=CreateNewTestCase

For the active programs, i want use the ShortCut "CTRL+a", for Programm 1 I want run the function CreateNewTestCase, for Programm 2 I want run another function. I want give this string to the call-command for executing the right function for CTRL+a for program 1 CreateNewTestCase and for Programm 2 the function CreateNewFolder. But I want this both on one shortcut. Which function is specified in the INI-File. But the HotKeySet-function dont support Parameters for the function which it calls.

Bye Crash

Edited by Crash_Master
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...