 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
David.P
Joined: 18 Nov 2006 Posts: 304
|
Posted: Thu Aug 14, 2008 2:16 pm Post subject: Control Audacity when in Background? |
|
|
Hi forum,
I need to control Audacity when its window is not active. I have already tried SendMessage and ControlSend, but Audacity doesn't really do anything.
I really just need to send "r" or {Space} to Audacity to start or stop a recording, respectively.
Thanks already for any hints how to do this,
David.P |
|
| Back to top |
|
 |
Red Hat Dude Guest
|
Posted: Thu Aug 14, 2008 3:22 pm Post subject: |
|
|
This is kinda...an ugly alternative, but it works at least.
| Code: | process, exist, audacity.exe
if errorlevel
myPID := ErrorLevel
else
{
Msgbox No Audacity process was found running. Exiting...
ExitApp
}
;
HiddenMode = -1
left::
HiddenMode *= -1
if HiddenMode = 1
WinSet, Transparent, 0, ahk_pid %myPID%
else
{
WinSet, Transparent, 255, ahk_pid %myPID%
WinSet, Transparent, Off, ahk_pid %myPID%
}
return
up::
WinActivate, ahk_pid %myPID%
ControlSend, , r, ahk_pid %myPID%
WinMinimize, ahk_pid %myPID%
return
down::
WinActivate, ahk_pid %myPID%
ControlSend, , {Space}, ahk_pid %myPID%
WinMinimize, ahk_pid %myPID%
return |
You can assign up to controlsend r to audacity, but it will do nothing unless Audacity has focus. I don't think there's any way around that. Also, it won't work with WinHide/WinShow either...and, strangely, I can't unhide the window with WinShow using the PID. |
|
| Back to top |
|
 |
David.P
Joined: 18 Nov 2006 Posts: 304
|
Posted: Thu Aug 14, 2008 3:27 pm Post subject: |
|
|
Hi and thanks,
does this mean that you set the Audacity window to transparent and then put it foremost...?
If yes, probably it won't work, really -- I need to interact with another program in the foreground at the same time when the recording is started.
Any other ideas, please...?
Thanks already,
David.P |
|
| Back to top |
|
 |
Red Hat Boy
Joined: 10 Apr 2008 Posts: 111
|
Posted: Thu Aug 14, 2008 5:19 pm Post subject: |
|
|
None that I can think of, aside from getting a new app to record with. In my tests, Audacity was definitely being sent the 'r' key ('up' wouldn't function as it normally would, and notepad wouldn't receive the 'r', but if Audacity had focus the up key would work like the r key). Audacity won't let you set a global hotkey, either, so I don't know... _________________ I slit the sheet, the sheet I slit,
and on the slitted sheet I sit. ;~} |
|
| Back to top |
|
 |
David.P
Joined: 18 Nov 2006 Posts: 304
|
Posted: Thu Aug 14, 2008 5:52 pm Post subject: |
|
|
Thanks very much.
I'll use an old version of CoolEdit then.
Cheers David.P |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|