I have automated some actions in the past in Audacity without any problems.
WinMenuSelectItem seemed to work good in comibination with ControlSent and ControlClick, I used "ahk_exe audacity.exe" to target the window.
Here is the script, but it was written for the dutch language, so you will need to rewrite it.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance, Force
File := "C:\Users\test\Documents\PJVP\Oefenbestanden\OK - Perhaps Love\TENOR_PERHAPS LOVE.mp3"
File_New := StrReplace(File, ".mp3", "_91.mp3")
; Convert mp3 to slower speed
Controlsend, , ^o, ahk_exe audacity.exe
WinWait, Selecteer een of meerdere bestanden ahk_exe audacity.exe
ControlSetText, Edit1, %File%, Selecteer een of meerdere bestanden ahk_exe audacity.exe
Controlsend, Edit1, {enter}, Selecteer een of meerdere bestanden ahk_exe audacity.exe
WinWait, Importeren ahk_exe audacity.exe
WinwaitClose, Importeren ahk_exe audacity.exe
sleep, 500
Controlsend, , ^a, ahk_exe audacity.exe
WinMenuSelectItem, ahk_exe audacity.exe, , Effecten, Tempo Wijzigen...
WinWait, Tempo wijzigen
ControlSetText, Edit1, -9, Tempo wijzigen
ControlClick, Button8, Tempo wijzigen
WinWait, Hoge kwaliteit tempowijziging
WinWaitClose, Hoge kwaliteit tempowijziging
WinMenuSelectItem, ahk_exe audacity.exe, , Bestand, Exporteren, Exporteren als MP3
WinWait, Audio exporteren ahk_exe audacity.exe
ControlSetText, Edit1, %File_New%, Audio exporteren ahk_exe audacity.exe
Controlsend, Edit1, {enter}, Audio exporteren ahk_exe audacity.exe
Winwait, Metadata-tags bewerken ahk_exe audacity.exe
ControlClick, Button12, Metadata-tags bewerken ahk_exe audacity.exe
WinwaitClose, Metadata-tags bewerken ahk_exe audacity.exe
SplitPath, File_New, , , , OutNameNoExt
WinWait, %OutNameNoExt% ahk_exe audacity.exe
WinWaitClose, %OutNameNoExt% ahk_exe audacity.exe
sleep, 500
Controlsend, , ^w, ahk_exe audacity.exe
Winwait, Wijzigingen oplaan in ahk_exe audacity.exe
ControlClick, Button2, Wijzigingen oplaan in ahk_exe audacity.exe