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
Audacity Automation - Instant Record
Started by
marky1984
, Jan 11 2008 09:39 AM
19 replies to this topic
#1
-
Posted 11 January 2008 - 09:39 AM
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
#2
-
Posted 11 January 2008 - 09:53 AM
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
Run %A_ProgramFiles%\Audacity\audacity.exe
WinWait audacity.exe
WinActivate
Send r
#3
-
Posted 11 January 2008 - 10:05 AM
Check out AHK's Control command set. Good luck. 8)
#4
-
Posted 11 January 2008 - 10:15 AM
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
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
#5
-
Posted 11 January 2008 - 10:30 AM
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.
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.
#6
-
Posted 11 January 2008 - 10:40 AM
thanks Max but it still won't register pressing "r"
EDIT< just trying that other bit
EDIT< just trying that other bit
#7
-
Posted 11 January 2008 - 10:43 AM
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
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
#8
-
Posted 11 January 2008 - 10:46 AM
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
it just runs audacity and sits there, no recording starts, it will start if i manually press "r" however
#10
-
Posted 11 January 2008 - 10:52 AM
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
#11
-
Posted 11 January 2008 - 10:53 AM
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"
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"
#12
-
Posted 11 January 2008 - 10:55 AM
@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 )<<<<
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 )<<<<
#13
-
Posted 11 January 2008 - 11:06 AM
Sorry it took me so long---hold on, I'm reading...
#14
-
Posted 11 January 2008 - 11:19 AM
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%
}
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%
}
#15
-
Posted 11 January 2008 - 11:25 AM