User Tools

Site Tools


autohotkey

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
autohotkey [2013/03/30 17:54]
jariw
autohotkey [2013/04/28 17:17]
jariw
Line 2: Line 2:
  
 AutoHotkey is a script-based Windows freeware macro application that's robust and extremely powerful, although it has some learning curve to work fluently (there are also GUI frontends and other tools available to simplify tasks). However, once the basic script is set up, adding new tasks is extremely trivial. This page contains functions and scripts to get you started. AutoHotkey is a script-based Windows freeware macro application that's robust and extremely powerful, although it has some learning curve to work fluently (there are also GUI frontends and other tools available to simplify tasks). However, once the basic script is set up, adding new tasks is extremely trivial. This page contains functions and scripts to get you started.
 +
 +The full example can be downloaded here, so you can tweak it with more hotkeys: {{:​wiki:​autohotkey:​finale-autohotkey-jwplugins.zip|Finale-autohotkey-jwplugins.zip}}
 +
 +==== All you need to know ====
 +
 +When you're basic script is set up, the following example should cover all you need to know to interact with the plug-in:
 +<​code>​
 +#​IfWinActive,​ ahk_class Finale
 +^!T::
 +if (openJWpluginwindow("​JW Plug-ins",​ "JW Meter and Rhythm",​ 5, 1) = 1)
 +{
 +   ​setJWpluginpanelvalue("​JW Meter and Rhythm",​ 1, 1)
 +   ​applyandcloseJWpluginwindow("​JW Meter and Rhythm"​)
 +}
 +return
 +</​code>​
 +
 +Since it's important to understand these lines of code, here's a closer look.
 +
 +  #​IfWinActive,​ ahk_class Finale
 +means that the keyboard macro will only be available **when Finale is active**. (More specifically,​ it requires that a window with a window class called Finale is active.)
 +
 +  ^!T::
 +is the **start of a keyboard macro**. ^ is the //Ctrl// key. ! is the //Alt// key. So the keyboard combination in the example is //​Ctrl+Alt+T//​.
 +
 +  if (openJWpluginwindow("​JW Plug-ins",​ "JW Meter and Rhythm",​ 5, 1) = 1)
 +calls the openJWpluginwindow function in the script (the code for the function is listed below). The function will start the plug-in from the menu, assure that the window opens and select container and task in the window. If everything went well, the function returns 1. //Since the plug-in is modeless, you can execute this function even if the window is already on the screen.// The first parameter to the function is the name of the submenu in Finale'​s //Plug-in// menu.
 +
 +==== How the code works ====
 +
 +This section lists the specific functions and other code that are required for the script.
  
 At the start of the script, add the following standard lines: ​ At the start of the script, add the following standard lines: ​
Line 114: Line 145:
 </​code>​ </​code>​
  
-/* The //​applyandcloseJWpluginwindow()//​ function will simulate a press of the Enter key and close the plug-in window. */+The //​applyandcloseJWpluginwindow()//​ function will simulate a press of the Enter key and close the plug-in window:
 <​code>​ <​code>​
 applyandcloseJWpluginwindow(pluginname) applyandcloseJWpluginwindow(pluginname)
Line 135: Line 166:
  
  
-<​code>​ 
-#​IfWinActive,​ ahk_class Finale 
-^!T:: 
-if (openJWpluginwindow("",​ "JW Meter and Rhythm",​ 5, 1) = 1) 
-{ 
-   ​setJWpluginpanelvalue("​JW Meter and Rhythm",​ 1, 1) 
-   ​applyandcloseJWpluginwindow("​JW Meter and Rhythm"​) 
-} 
-return 
-</​code>​ 
  
autohotkey.txt ยท Last modified: 2013/04/28 17:17 by jariw