Autohotkeys: Difference between revisions

From Librivox wiki
Jump to navigationJump to search
 
(7 intermediate revisions by the same user not shown)
Line 6: Line 6:


In LibriVox, it is used with Audacity to make editing quicker and easier. (thanks to Karlsson for the following information)
In LibriVox, it is used with Audacity to make editing quicker and easier. (thanks to Karlsson for the following information)
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.


To download and install:  
To download and install:  


1) Install. go to [http://www.autohotkey.com/]  click the first link Installer for Autohotkey.  
1) Install. go to [http://www.autohotkey.com/]  click the first link Installer for Autohotkey.  
follow the dialog boxes and install on your computer.
follow the dialog boxes and install the program 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.
2) Add a script for Autohotkeys to follow.  Start Notepad, go to [http://philslibrivoxpage.wikispaces.com/]and copy the script in red, then  save it on your desktop as a simple text file with the extension .ahk   (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.
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.
Line 28: Line 19:
*) 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".  
*) 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 :
The script that you are copying from philslibrivoxpage contains 4 different hot key combinations:
 
 
'''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.
 
;delete a marked range:
SC03A & d::<br />
{<br />
Send, z<br />
Send, {Delete}<br />
Send, {Left 15}<br />
Send, ^2<br />
Send, {Space}<br />
}<br />
Return
 
 
Deamplify the current selection by 3
 
;deamplify x3
{
SC03A & 3::<br />
Send, !c<br />
Send, A<br />
Send, {Enter}<br />
Send, -3<br />
Send, {Enter}<br />
Send, {Left 40}<br />
Send, ^2<br />
Send, {space}<br />
Return<br />
}<br />
Return<br />
 
Deamplify the current selection by 4
 
;deamplify x 4<br />
{<br />
SC03A & 4::<br />
Send, !c<br />
Send, A<br />
Send, {Enter}<br />
Send, -4<br />
Send, {Enter}<br />
Send, {Left 40}
Send, ^2<br />
Send, {space}<br />
Return<br />
 
 
Amplify the current selection by 2
 
;amplify x2<br />
SC03A & 2::<br />
{<br />
Send, !c<br />
Send, A<br />
Send, {Enter}<br />
Send, 2<br />
Send, {Enter}<br />
Send, {Left 40}<br />
Send, ^2<br />
Send, {space}<br />
}<br />
Return<br />


---Stop copying here ---------
CapsLock & D  =  will delete a selection after finding z crossings, then zoom out to normal, back up 2 seconds and start the playback.
CapsLock & 2  =  will amplify the selection X2
CapsLock & 3  =  will deamplify the selection X3
CapsLock & 4  =  will deamplify the selection X4.


3) rename the text document Autohotkey script.ahk
You should hold down the CapsLock while pressing the other key at the same time.  


4) double click on that document and you can use autohotkeys!!!
Other scripts can be written of course and can be added to this script or made into stand alone scripts.  To see how to create your own scripts
and edit the ones you have, go to [http://www.autohotkey.com/docs/].

Latest revision as of 03:34, 14 March 2012

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 the program on your computer.

2) Add a script for Autohotkeys to follow. Start Notepad, go to [2]and copy the script in red, then save it on your desktop as a simple text file with the extension .ahk (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.


The script that you are copying from philslibrivoxpage contains 4 different hot key combinations:

CapsLock & D = will delete a selection after finding z crossings, then zoom out to normal, back up 2 seconds and start the playback. CapsLock & 2 = will amplify the selection X2 CapsLock & 3 = will deamplify the selection X3 CapsLock & 4 = will deamplify the selection X4.

You should hold down the CapsLock while pressing the other key at the same time.

Other scripts can be written of course and can be added to this script or made into stand alone scripts. To see how to create your own scripts and edit the ones you have, go to [3].