Jump to content

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

Audacity Automation - Instant Record


  • Please log in to reply
19 replies to this topic
marky1984
  • Members
  • 10 posts
  • Last active: Jan 11 2008 09:35 AM
  • Joined: 11 Jan 2008
Hi, real noob at this but any help would be appreciated

I am trying to get audacity to instantly record after a shortcut key is pressed.

So i have made a script to run audacity.exe, this works fine. however in audacity the "r" key will start recording, so:

Run %A_ProgramFiles%\Audacity\audacity.exe
Send {R 1}

however this just starts audacity and will not record, am alittle confused to why this won't work

Thanks

Mark

marky1984
  • Members
  • 10 posts
  • Last active: Jan 11 2008 09:35 AM
  • Joined: 11 Jan 2008
i have noticed the script is send the "r" however it is not registering on audacity because it is not the front window, i am trying to use winactivate but failing

marky1984
  • Members
  • 10 posts
  • Last active: Jan 11 2008 09:35 AM
  • Joined: 11 Jan 2008
ok i have audacity at the front, but not it won't register that i have press the "r" key

Run %A_ProgramFiles%\Audacity\audacity.exe
WinWait audacity.exe
WinActivate
Send r

BoBo¨
  • Guests
  • Last active:
  • Joined: --
Check out AHK's Control command set. Good luck. 8)

marky1984
  • Members
  • 10 posts
  • Last active: Jan 11 2008 09:35 AM
  • Joined: 11 Jan 2008
not having much luck, from what i can gather i should be using:



Run %A_ProgramFiles%\Audacity\audacity.exe
WinWait audacity.exe
WinActivate
ControlSendRaw,, r

however this doesn't work

have also tried this which seems suggest it should work, still not joy

Run %A_ProgramFiles%\Audacity\audacity.exe
WinWait audacity.exe
WinActivate
ControlSend, , r, %A_ProgramFiles%\Audacity\audacity.exe

any help would be great

MaxWeiss
  • Members
  • 62 posts
  • Last active: May 24 2010 10:24 PM
  • Joined: 15 Sep 2007
Run %A_ProgramFiles%\Audacity\audacity.exe
Process, Exist, audacity.exe
AudacityID = %ErrorLevel%
IfNotEqual, AudacityID, 0
ControlSend, , r, ahk_pid %AudacityID%
Else
MsgBox, , Error, Please make sure that "audacity.exe" is actually the name of the process of the Audacity Program


Or, if recording is an option in one of the menu's instead of ControlSend, you could try WinMenuSelectItem, using the PID as above.

marky1984
  • Members
  • 10 posts
  • Last active: Jan 11 2008 09:35 AM
  • Joined: 11 Jan 2008
thanks Max but it still won't register pressing "r"

EDIT< just trying that other bit

marky1984
  • Members
  • 10 posts
  • Last active: Jan 11 2008 09:35 AM
  • Joined: 11 Jan 2008
no option in the menu to use record,

can't work it out, if i run audacity then actually press r it starts recording stright away. i know the r is being sent as well because before i had the window restore part it would also highlight the first folder that start with r in where i was running it from

MaxWeiss
  • Members
  • 62 posts
  • Last active: May 24 2010 10:24 PM
  • Joined: 15 Sep 2007
I just edited my post. Try the new code.

marky1984
  • Members
  • 10 posts
  • Last active: Jan 11 2008 09:35 AM
  • Joined: 11 Jan 2008
thanks again but still no joy

it just runs audacity and sits there, no recording starts, it will start if i manually press "r" however

  • Guests
  • Last active:
  • Joined: --
I think AutoHotkey really needs a RunWaitReady command...(no not RunWait, that waits until the program that was ran closes)...we need a way to wait until the Run has done something that is different than before the Run...like the following code...I tested in Notepad, but not in Audacity (although I do have Audacity too)...

;//program=audacity.exe
program=notepad

hwndprogram:=WinExist("a")

Run, %program%

WinWaitNotActive, ahk_pid %hwndprogram%

hwndprogram:=WinExist("a")

Send, r


MaxWeiss
  • Members
  • 62 posts
  • Last active: May 24 2010 10:24 PM
  • Joined: 15 Sep 2007
Ok, let's try this once more. First hit Ctrl+Alt+Delete and click on the second tab at the top and make sure the process name of the program is actually audacity.exe.

Assuming it is, open the AutoIt3 Window Spy from the AutoHotKey program files folder and open Audacity. Now Activate Audacity and move the mouse over the record button and tell me what it says in the section of the WIndows Spy under "Now under mouse cursor"

marky1984
  • Members
  • 10 posts
  • Last active: Jan 11 2008 09:35 AM
  • Joined: 11 Jan 2008
@guest

worked with notepad, however didn't bring audacity to the front

@max - process is definitly audacity.exe

>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Audacity
ahk_class wxWindowClass

>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen: 236, 80 (less often used)
In Active Window: 226, 70

>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<
ClassNN: wxWindowClass4
Text:
Color: 0x9696DD (Blue=96 Green=96 Red=DD)

>>>>>>>>>>( Active Window Position )<<<<<<<<<<
left: 10 top: 10 width: 697 height: 527

>>>>>>>>>>>( Status Bar Text )<<<<<<<<<<

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
scrollbar
scrollbar

>>>>>>>>>>>( Hidden Window Text )<<<<<<<<<<<

>>>>( TitleMatchMode=slow Visible Text )<<<<
Mic Volume

>>>>( TitleMatchMode=slow Hidden Text )<<<<

MaxWeiss
  • Members
  • 62 posts
  • Last active: May 24 2010 10:24 PM
  • Joined: 15 Sep 2007
Sorry it took me so long---hold on, I'm reading...

MaxWeiss
  • Members
  • 62 posts
  • Last active: May 24 2010 10:24 PM
  • Joined: 15 Sep 2007
Alright, here's two different codes. One of them will hopefully work.....


Run %A_ProgramFiles%\Audacity\audacity.exe
Process, Exist, audacity.exe
AudacityID = %ErrorLevel%
IfNotEqual, AudacityID, 0
ControlClick, wxWindowClass4, r, ahk_pid %AudacityID%



Run %A_ProgramFiles%\Audacity\audacity.exe
Process, Exist, audacity.exe
AudacityID = %ErrorLevel%
IfNotEqual, AudacityID, 0
ControlClick, X226 Y70, r, ahk_pid %AudacityID%



If neither works, then you'll have to try this as a last resort.....

Run %A_ProgramFiles%\Audacity\audacity.exe
Process, Exist, audacity.exe
AudacityID = %ErrorLevel%
IfNotEqual, AudacityID, 0
{
WinActivate, ahk_pid %AudacityID%
Click 226, 70
WinMinimizeahk_pid %AudacityID%
}