Autohotkeys

From Librivox wiki
Jump to navigationJump to search

AUTOHOTKEYS -

AutoHotkey is an open source scripting language for Windows that can automate and customize almost any action on your PC.

In LibriVox, it is used with Audacity to make editing quicker and easier. (thanks to Karlsson for the following information)

To download and install:

1) Install. go to [1] click the first link Installer for Autohotkey. follow the dialog boxes and install on your computer.

2) Add a script for Autohotkeys to follow. Start Notepad, copy the script below and save it as a simple text file with the extension .ahk at any place you want, e.g. as "audacity.ahk" on the desktop*). When you double-click the script-file, it becomes active and you find it as a green and white symbol with an "H" in your tray. Now you can select a range in Audacity, hit CapsLock+d ad you hear your corrected recording.

Of course you can choose any other hotkey, and you can edit the script in any way; look at the Autohotkey documentation. You can automate almost anything by sending keystrokes and mouse clicks, and you can write a mouse or keyboard macro by hand or use the macro recorder.

  • ) Important: the file must have the file-extension .ahk, and NOT .txt! indows 2000 and XP, open Windows Explorer and choose Tools | Folder Options | View, and uncheck the box for "Hide file extensions for known file types".

The most frequent action I have to do when editing audio data with Audacity is deleting repeats, silence or messed up words/phrases. Usually these steps have to be made: -Bold text selecting the range of data that I want to delete with the mouse - hit "z" to find Zero Crossings - hit "Delete" - click some centimetres left into the audio track to listen to the corrected data - hit "Space" to start playing.

I found this rather cumbersome; so now I use a single hotkey that I scripted with Autohotkey (http://www.autohotkey.com). So the only thing I have to do is to select the data and then hit "CapsLock + d", and I directly hear the corrected data.


These are some of the scripts that can be used :


Delete a selection

(find Z crossings, delete selection,back up 2 seconds, zoom back to normal and begin playback)

---copy from below this line to the next line ---------------- paste this into your text document.

AutoHotkey Version
1.x
Language
English
Platform
Win9x/NT
Author
Karlsson
Script Function
supports editing audiotracks with Audacity
  1. NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.

SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.


delete a marked range

SC03A & d::
{
Send, z
Send, {Delete}
Send, {Left 15}
Send, ^2
Send, {Space}
}
Return


Deamplify the current selection by 3

deamplify x3

{ SC03A & 3::
Send, !c
Send, A
Send, {Enter}
Send, -3
Send, {Enter}
Send, {Left 40}
Send, ^2
Send, {space}
Return
}
Return

Deamplify the current selection by 4

deamplify x 4

{
SC03A & 4::
Send, !c
Send, A
Send, {Enter}
Send, -4
Send, {Enter}
Send, {Left 40} Send, ^2
Send, {space}
Return


Amplify the current selection by 2

amplify x2

SC03A & 2::
{
Send, !c
Send, A
Send, {Enter}
Send, 2
Send, {Enter}
Send, {Left 40}
Send, ^2
Send, {space}
}
Return

---Stop copying here ---------

3) rename the text document Autohotkey script.ahk

4) double click on that document and you can use autohotkeys!!!