Monday, January 15, 2007

Using AutoHotkey to open common bins

Software: Avid (All versions)
Platform: Windows
Skill Level: Intermediate

A lot of my editing time is spent using the same bins over and over: Graphics bins, Voiceover bins etc. I edit a weekly show, and I used to automate the opening of these bins by creating a template project and then copying that project name to the weekly series name each time I needed it (I wrote a Windows script that made this a bit easier).

Recently I discovered a slightly more flexible way of doing this using the brilliant open source program AutoHotkey. Now I must stress that I'm using this program in a very dumbed-down way. AutoHotkey is capable of creating remarkable automation macros that incorporate keyboard, mouse and other user input. The macro I've listed below is basically just setting up a series of key combinations to open my common bins. So if you'd like to duplicate my methods, just follow these steps:

  1. Download and install AutoHotkey.
  2. Copy and Paste my macro text below (the section in grey courier font) into a text file, and save it somewhere on your Avid with an .ahk extension. I.E. AvidKeys.ahk
  3. Modify the path names and the hotkeys to suit your installation.
  4. Double-click on the .ahk file, and those hotkeys will now open the bins you requested in one step. (The comments after any semi-colon explain most of the functions - the AutoHotkey help file has complete documentation)

;AVID Common Commands AutoHotkey Script

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

;Each bin (complete path, name and extension is assigned to a variable)

GFX = C:\Avid Projects\_OL 2006\_GFX 2006\00 GFX MASTER 2006.avb
SOURCE = C:\Avid Projects\_OL 2006\_GFX 2006\10 GFX SOURCE 2006.avb
VO = H:\Offline projects\_BHAG 12 OFFLINE\FINAL VO
PROJ = H:\Offline projects\_BHAG 12 OFFLINE
ONLINE = H:\Online projects\_OL 2006
MUSIC = C:\Avid Projects\_OL 2006\_GFX 2006\21 Music 2006.avb
FX = C:\Avid Projects\_OL 2006\_GFX 2006\22 Sound FX.avb
CMAPS = G:\2006 Climate Maps\By Zone

;# corresponds to the WINDOWS key, and ! is ALT - so the hotkey to open my common graphics bin is WINDOWS-ALT-G

#!g::
SendInput ^9
SendInput ^o
SendInput %GFX%
SendInput {Enter}
return


#!s::
SendInput ^9
SendInput ^o
SendInput %SOURCE%
SendInput {Enter}
return

#!v::
SendInput ^9
SendInput ^o
SendInput %VO%
SendInput {Enter}
return

#!p::
SendInput ^9
SendInput ^o
SendInput %PROJ%
SendInput {Enter}
return

#!o::
SendInput ^9
SendInput ^o
SendInput %ONLINE%
SendInput {Enter}
return

#!m::
SendInput ^9
SendInput ^o
SendInput %MUSIC%
SendInput {Enter}
return

#!f::
SendInput ^9
SendInput ^o
SendInput %FX%
SendInput {Enter}
return

#!c::
SendInput i
SendInput %CMAPS%
SendInput {Enter}
return

;WINDOWS-ALT-N adds 4 video tracks and 10 audio tracks to any existing sequence.

#!n::
SendInput ^y^y^y^y
SendInput ^u^u^u^u^u^u^u^u^u^u
return

#!z::
SendInput ^y^y^y^y^y
SendInput ^u^u^u^u^u^u^u^u^u^u^u^u
return


Disclaimer

Labels: , , ,

5 Comments:

At 9:31 PM, Anonymous Anonymous said...

That tip has just saved me so much time. Thanks. Love it!!

 
At 1:07 AM, Anonymous enterpad said...

It can be easier to write (and read):

SendInput ^{u 12}

instead of:

SendInput ^u^u^u^u^u^u^u^u^u^u^u^u

Also everything is fine to remember few hotkeys like #!g, #!s, #!v, #!p, #!o, #!m, #!f, #!c, #!n, #!z in your case. Probably you would like to use more hotkeys but it is not practical to remember all of them. The trick is to use AutoHotkey with the Enterpad overlay keyboard.

 
At 3:47 PM, Blogger Grant said...

Thanks Enterpad - that's a great little tip.

 
At 11:41 PM, Blogger woodced said...

I've always wanted to try to hotkey gang buttons in the audio mixer window (e.g. F5 gangs/ungangs A1-A2 in the Audio Mixer tool). I tried to write a hooking program to do this, but had a problem with it (The Audio Mixer window just didn't respond to SendMouse Hook events - I became busy with editing work and had to move on so there may have been a simple solution).

Have you tried using AutoHotKey to click on buttons in sub windows by any chance?

I'll have a go and let you know if I get any joy.

 
At 5:45 AM, Blogger woodced said...

I've got it working on the Audio Mixer tool. Below is the script. Obviously you have to keep your audio mixer tool in the same place with this method, and you will have to find out the coordinates of the buttons yourself, but it's a start:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. Note the strange performance with the Grp1/2 button which I have mapped to Alt+F9

;Each bin (complete path, name and extension is assigned to a variable)

;# corresponds to the WINDOWS key, and ! is ALT - so the hotkey to open my common graphics bin is WINDOWS-ALT-G

F9::
MouseGetPos, xpos, ypos
Click 1076, 217
Click 1122, 217
MouseMove, %xpos%, %ypos%
return

F10::
MouseGetPos, xpos, ypos
Click 1161, 217
Click 1208, 217
MouseMove, %xpos%, %ypos%
return

F11::
MouseGetPos, xpos, ypos
Click 1268, 217
Click 1309, 217
MouseMove, %xpos%, %ypos%
return

F12::
MouseGetPos, xpos, ypos
Click 1346, 217
Click 1394, 217
MouseMove, %xpos%, %ypos%
return

!F9::
MouseGetPos, xpos, ypos
MouseClick, left, 1329, 109
MouseMove, %xpos%, %ypos%
return

 

Post a Comment

<< Home