Notes:
You'll need to download and install AutoHotkey.
http://www.autohotkey.com/
Copy and save the code below to a text file and rename the extension to .ahk
You can drop it in the Startup folder to auto-execute at windows startup.
Button display text can contain spaces. Omit the spaces and change each command section to match the button.
example: Change button "Option 1" to read "Speaking Only", change ButtonOption1 to ButtonSpeakingOnly.
Change the session file and file path to match your desired sessions.
Download SmartGUI from the AutoHotkey website if you want to easily do more extensive editing to the GUI.
A similar task without the GUI commands could be created to launch SAC and bring the engine live without user intervention on startup. The Run, sleep and controlclick commands are all that's needed.
Brett and any autohotkey guru's know a better way to ensure SAC is open and the session is loaded than using a sleep command? Seems that should be doable. The main window loads first and you can't really depend on any other specific SAC window being open either, though they wouldn't be until the session is loaded. Maybe there's a way to check and ensure a process is running and a window title contains certain text?
- Code: Select all
Gui, Add, Button, x16 y40 w110 h50 +Center, Option 1
Gui, Add, Button, x146 y40 w110 h50 +Center, Option 2
Gui, Add, Button, x16 y110 w110 h50 +Center, Option 3
Gui, Add, Button, x146 y110 w110 h50 +Center, Stop SAC
Gui, Font, S16 CDefault Bold, Verdana
Gui, Add, Text, x26 y5 w220 h30 +Center, SAC Launcher
Gui, Show, h181 w277, SAC Launcher
Return
ButtonOption1:
IfWinNotExist, ahk_class SAC_MAIN
{
Run C:\SAC\sac.exe C:\SAC\Mix\test1.mxs
Sleep 1000
ControlClick x25 y55, ahk_class SAC_MAIN,, right,,Pos
}
Else
{}
Return
ButtonOption2:
IfWinNotExist, ahk_class SAC_MAIN
{
Run C:\SAC\sac.exe C:\SAC\Mix\test2.mxs
Sleep 1000
ControlClick x25 y55, ahk_class SAC_MAIN,, right,,Pos
}
Else
{}
Return
ButtonOption3:
IfWinNotExist, ahk_class SAC_MAIN
{
Run C:\SAC\sac.exe C:\SAC\Mix\test3.mxs
Sleep 1000
ControlClick x25 y55, ahk_class SAC_MAIN,, right,,Pos
}
Else
{}
Return
ButtonStopSAC:
IfWinExist, ahk_class SAC_MAIN
{
ControlClick x25 y55, ahk_class SAC_MAIN,, right,,Pos
WinClose ahk_class SAC_MAIN
}
Else
{
}
Return
GuiClose:
ExitApp