AutoHotkey Community

It is currently May 26th, 2012, 10:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: August 14th, 2008, 3:16 pm 
Offline

Joined: November 18th, 2006, 7:56 pm
Posts: 305
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 4:22 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 4:27 pm 
Offline

Joined: November 18th, 2006, 7:56 pm
Posts: 305
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 6:19 pm 
Offline

Joined: April 10th, 2008, 10:08 pm
Posts: 111
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. ;~}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 6:52 pm 
Offline

Joined: November 18th, 2006, 7:56 pm
Posts: 305
Thanks very much.

I'll use an old version of CoolEdit then.

Cheers David.P


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: bobbysoon, BrandonHotkey, Google [Bot], iBob35555VR, oldbrother, Tilter_of_Windmills, Yahoo [Bot] and 63 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group