Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Control Audacity when in Background?


  • Please log in to reply
4 replies to this topic
David.P
  • Members
  • 376 posts
  • Last active: Apr 29 2015 09:59 AM
  • Joined: 18 Nov 2006
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

Red Hat Dude
  • Guests
  • Last active:
  • Joined: --
This is kinda...an ugly alternative, but it works at least.

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.

David.P
  • Members
  • 376 posts
  • Last active: Apr 29 2015 09:59 AM
  • Joined: 18 Nov 2006
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

Red Hat Boy
  • Members
  • 121 posts
  • Last active: May 02 2014 06:44 PM
  • Joined: 10 Apr 2008
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...

You do not have permission to read this signature...


David.P
  • Members
  • 376 posts
  • Last active: Apr 29 2015 09:59 AM
  • Joined: 18 Nov 2006
Thanks very much.

I'll use an old version of CoolEdit then.

Cheers David.P