Scripting In Band In A Box - 10/18/21 08:25 PM
Scripting will allow you to create a single action or a GUI.
Hopefully this should be added to the Biab menu "Scripts"
so any AHK scripts in \bb\Scripts will shown in the menu and run from there with one click.
Any ahk scripts in sub folders will show in sub menus allowing you to put them in categories.
To get started Download https://www.autohotkey.com/
If you have Biab running As Administrator go to the install folder
C:\Program Files\AutoHotkey and set AutoHotkey.exe to Run As Administrator.
Here is a simple basic action to set the Tempo
copy and paste into Notepad and save as Edit Tempo.ahk
winactivate will focus on the Biab window (ahk_class TBandWindow)
you get the window or dialog name by running WindowSpy.ahk and clicking on the window or dialog you want to focus on and it will give you the ahk_class name.
Send will send a keystroke or combination ^!t is ctrl+alt+t
^ = ctrl
+ = shift
! = alt
# = win
If we want to set the Tempo to 80bpm
{Enter} will send enter key to enter amount and close dialog.
To access menus we use WinMenuSelectItem
The name needs to be exactly the same as in the actual menu.
Sleep will give a delay to give Biab time to run a function before sending another command.
Sleep, 1000 = 1 sec delay
so you can put that in the line before a Send to give Biab a bit of time to do what it needs to do.
Some Dialogs will allow short keys so if you press alt key they will show an undersccore for the shortcut key, so we
Send, !d
To navigate you can Send, {Tab} (this will remove Harmony)
Send, {Tab 7} = send Tab 7 times
Send, +{Tab 3} = send shift+tab 3 times
To put a pause or message box with Ok button
MsgBox, Text to Show
Here's a simple always on top GUI with 1 button.
You can add more buttons, each button (gAction01) will have a function (Action01: ???? Return) below:
There is no end of info for doing almost anything, let me know what action you need or just do an internet search: autohotkey "what I want to do"
Hopefully this should be added to the Biab menu "Scripts"
so any AHK scripts in \bb\Scripts will shown in the menu and run from there with one click.
Any ahk scripts in sub folders will show in sub menus allowing you to put them in categories.
To get started Download https://www.autohotkey.com/
If you have Biab running As Administrator go to the install folder
C:\Program Files\AutoHotkey and set AutoHotkey.exe to Run As Administrator.
Here is a simple basic action to set the Tempo
Code:
#SingleInstance Force winactivate, ahk_class TBandWindow Send, ^!t ExitApp
winactivate will focus on the Biab window (ahk_class TBandWindow)
you get the window or dialog name by running WindowSpy.ahk and clicking on the window or dialog you want to focus on and it will give you the ahk_class name.
Send will send a keystroke or combination ^!t is ctrl+alt+t
^ = ctrl
+ = shift
! = alt
# = win
If we want to set the Tempo to 80bpm
Code:
#SingleInstance Force winactivate, ahk_class TBandWindow Send, ^!t Send, 80 Send, {Enter} ExitApp
{Enter} will send enter key to enter amount and close dialog.
To access menus we use WinMenuSelectItem
Code:
#SingleInstance Force WinMenuSelectItem, ahk_class TBandWindow, , Edit, Insert Bar(s)... ExitApp
The name needs to be exactly the same as in the actual menu.
Sleep will give a delay to give Biab time to run a function before sending another command.
Sleep, 1000 = 1 sec delay
so you can put that in the line before a Send to give Biab a bit of time to do what it needs to do.
Some Dialogs will allow short keys so if you press alt key they will show an undersccore for the shortcut key, so we
Send, !d
To navigate you can Send, {Tab} (this will remove Harmony)
Code:
#SingleInstance Force WinMenuSelectItem, ahk_class TBandWindow, , Harmony, Melody Harmony (select)... Sleep, 500 winactivate, ahk_class TSELECTMELODYHARMONYDIALOG Send, {Tab 7} Send, {Enter} ExitApp
Send, {Tab 7} = send Tab 7 times
Send, +{Tab 3} = send shift+tab 3 times
To put a pause or message box with Ok button
MsgBox, Text to Show
Here's a simple always on top GUI with 1 button.
You can add more buttons, each button (gAction01) will have a function (Action01: ???? Return) below:
Code:
#NoEnv #SingleInstance Force Gui, +AlwaysOnTop Gui, Font, S10 cBlue Bold, Arial Gui, Add, Text, x10 y10, Some Text Gui, Add, Button, x10 y30 h38 w130 gAction01, Name of Button Gui Show, w300 h300, GUI Window Name Return Action01: winactivate, ahk_class TBandWindow Send, ^!t Send, 80 Send, {Enter} Return GuiClose: GuiEscape: ExitApp
There is no end of info for doing almost anything, let me know what action you need or just do an internet search: autohotkey "what I want to do"