@serenityjazz & gemisigo: Thanks for giving user to user support.
@bennomoehlman: serenityjazz & gemisigo gave you correct answer. Here's one more way how to do it. In
My functions.ahk, located in
RM\My codes folder, make a
Send function that accepts one parameter;
Send(What) {
Send, %What%
}
and in item action, specify
Action = fun Send|^+a. Using this method, you can have just one Send function and use it to send anything. Examples:
Action = fun Send|^a
Action = fun Send|I love AutoHotkey
Action = fun Send|^wetc..
@gemisigo:Yes, it's possible to modify menu on-the-fly on 2 ways. Here's the way I recommend;
Open
RM\Internal\Codes\RMApp lib.ahk Go to line 1222 . There you'll find:
RM2_Off(). Just comment this line like this;
;RM2_Off()
Now
RM2module and
GDI+ will stay turned on, and all bitmaps that are used to draw menu elements will stay in memory. That allows you to update menus on the fly.
Than open
RM\Radial menu.ahk and put
RM2_Off() in the
RMApp_OnExit subroutine, like this:
RMApp_OnExit: ; on exit subroutine
[color=#ff0000]RM2_Off()[/color]
RMApp_OnExit()
; you can put or include your OnExit code here
ExitApp
Now RM will now that it has to dispose of bitmaps used to draw menu elements and turn off GDI+
on RM exit.
Open
My hotkeys.ahk and put this code inside.
MButton::RMApp_MyRMHandler2(70)
F5::
MenuDefinition = ; of course, you can load it directly from file. Example: RMApp_LoadMenu(56, "C:\Radial menu 1.txt")
(`
[Item1]
Icon= Calculator.png
Action= %A_WinDir%\system32\calc.exe
)
RMApp_LoadMenu(70, MenuDefinition) ; loads radial menu from variable (string), uses Gui number 70.
return
F6::
MenuDefinition = ; of course, you can load it directly from file. Example: RMApp_LoadMenu(56, "C:\Radial menu 2.txt")
(`
[Item3]
Icon= Paint.png
Action= %A_WinDir%\system32\mspaint.exe
)
RMApp_LoadMenu(70, MenuDefinition) ; loads radial menu from variable (string), uses Gui number 70.
return
F7::
MenuDefinition = ; of course, you can load it directly from file. Example: RMApp_LoadMenu(56, "C:\Radial menu 3.txt")
(`
[Item5]
Icon= Notepad.png
Action= %A_WinDir%\notepad.exe
)
RMApp_LoadMenu(70, MenuDefinition) ; loads radial menu from variable (string), uses Gui number 70.
return
Imagine that every press on F5, F6, F7 hotkey is "
menu update event" in your code that reads specific file (or string, like in this example), and than updates the same menu (Gui number 70 in this example) on the fly. You could call those "
menu update events" via
SetTimer, or something else - that's up to you. This example can do 3 update types, but you can do as many updates you want - hundreds, thousands or more... The
RM2module and
GDI+ are turned on so you can update and redraw the same menu very fast and without problems. The only negative side is that now RM will consume a little bit more RAM, because all those bitmaps used to draw menu elements are in held memory. So resources will be freed on
RM exit, not on
RM auto-execute end (which it does by default).
In this example we modified 1 line of internal codes, but in upcoming updates, I think I'll give users an option to leave
RM2module and
GDI+ turned on after
RM auto-execute end, without need to modify internal codes.
@randomguy:
Your request can be realized on a few ways. Here's the way I recommend;
Open
My functions.ahk in
RM\My codes folder, and put this function inside;
Portable(PathWithoutDrive) {
static Drive
if (Drive = "")
SplitPath, A_ScriptDir,,,,,Drive
Run, % Drive "" PathWithoutDrive
}
Let's say your portable USB or HDD is organised like this:
D:\photoshop portable\pts.exe
D:\App2\App2.exe
D:\Some documents\Document.doc
D:\Radial menu
Now, if you want to run
D:\photoshop portable\pts.exe, in item action specify
Action = fun Portable|photoshop portable\pts.exefor
D:\App2\App2.exe, specify
Action = fun Portable|App2\App2.exeand for
D:\Some documents\Document.doc, specify
Action = fun Portable|Some documents\Document.docetc.
That's it. RM will auto detect letter of your portable drive. For example, on one computer it may be
D:\ on another
F:\ etc. but by using technique described above, you won't have problems with that.