Thursday, July 10, 2014

Automatic via hot key

I generally start SmartSDR, DDUTIL_V3, SDR-Bridge, and SDRMemory6K when I turn on the radio.  I also have to set DAX to 96000 and turn on channel 1.  I decided to look into if there was a way to automate most or all of this.  In another discussion Al K0VM mentioned the program autohotkeys.  I wondered what the heck ms that?  It turns out its a scripting program that allows you to automate many things in windows using hot keys on the keyboard.  JUST EXACTLY WHAT I NEED

You download and install AutoHotKey from the web site and install.  It's a free download.

There is a Help file that includes a tutorial (quick start),  Not being one to read the directions I started.

To create a script you right click somewhere on the desktop and choose New>AutoHotKey script

This creates an icon that you have to name  with the extension .ahk  I named my icon start.ahk

Once created you right click the icon and choose Edit Script

When you do that notepad opens so you can edit the script called start.ahk

I added the text


Run C:\\Users\Lee\Desktop\link\DDUtil_V3
Run C:\\Users\Lee\Desktop\link\SDRMemory6K
Run C:\\Users\Lee\Desktop\link\SDR-Bridge

What this does is tell the script when I hit the winkey plus x to execute the following links

I have the links stored in a folder called links on my desktop

Note you can get the exact address of the link by clicking the little folder in the url bar.  

Once you have the links the way you want it save the notepad file start.ahk

click the start .ahk icon and the script will load into memory.  If you now press winkey-x and you have the addresses correct and the programs loaded... all hell breaks loose!  DDUTIL SDR-Bridge and SDRMeemory6K come flying up and all load themselves!  Perfect

I also load DXLab but there is some glitch between DDUTIL, SmartCAT, and DXLab that causes SmartCAT to crash the first time you try to change freq.  I found that does not happen if you load DXLab before you load the others.  So I made another script and attached it ti winkey-z called launch.ahk

I right click launch,ahk and hit edit script and add the following 

Run C:\\Users\Lee\Desktop\link\DXLabLauncher

a link for DXLabLauncher was already in my link folder.  Save launch.ahk

Launcher has a feature that allows auto start:

click the launch.ahk icon to load into memory and then hit winkey-z and pretty soon the DXLab suite is cooking on all 8 cylinders.  

So my start up sequence is to start SmartSDR, hit winkey-z wait and then hit winkey-x and all of my programs are loaded, while I'm waiting for the radio to finish loading

You can make the scripts active with each boot if you place the scripts in the startup folder in windows.  To do that go to the program icons and under windows system you will see Run  I think in windows 7 the line is in the programs area.  I use 8.1

Type  shell:startup into run and OK

copy and paste the scripts into the startup folder

 Now when you restart the scripts will be active and to start your programs just hit winkey-z, winkey-x

I thought about adding SmartSDR but I am on the alpha team and we update the program every so often so I would always be changing the scripts.  I don't know if there is a way to get DAX to show itself, which would be very cool, but I'm happy to have gotten this far tonight

73  W9OY


I did a little more reading and now have everything working under one HOTKEY combo.  It turns out there are hot keys already assigned to the winkey button so I added this combination !#x:: which is Alt-WinKey-x.  So Alt Windows key and the letter x is the combination that fires off the script.  In addition I figured out how to make things sequence in a way that avoids SmartCAT from crashing.  Finally I made the SDR-Bridge window automatically close itself.  This file I modified is the file in the startup folder called start.ahk

So the boot sequence is 

turn on computer  
turn on radio
turn on SmartSDR 
turn on DAX
wait till the radio boots and turn it on
hit Alt-WinKey-x
let the process progress until every thing is cooking

Much simpler!  Replace the script in start.ahk with


Run C:\\Users\Lee\Desktop\link\DXLabLauncher
WinWaitActive, SpotCollector

Run C:\\Users\Lee\Desktop\link\DDUtil_V3
Run C:\\Users\Lee\Desktop\link\SDRMemory6K
Run C:\\Users\Lee\Desktop\link\SDR-Bridge
WinWait, Radio FLEX-6300