Skip to content

Instantly share code, notes, and snippets.

@swalberg
Last active January 12, 2023 07:19
Show Gist options
  • Save swalberg/6ba5b89924f6a6a40f713e4b260ae731 to your computer and use it in GitHub Desktop.
Save swalberg/6ba5b89924f6a6a40f713e4b260ae731 to your computer and use it in GitHub Desktop.
Getting RUMLogNG to do SKCC lookups and populate user field 4/notes
#!/bin/sh
call=$1
op=$2
DB=~/Documents/SKCCLogger/skcclist.txt
DB_URL=https://www.skccgroup.com/search/skcclist.txt
# If the DB is a day old or less then update it
file=$(find $DB -mmin -1440)
if [ -z "$file" ]; then
curl -so $DB $DB_URL
fi
case $op in
nr)
awk -F\| "\$2==\"$call\" { print \$1 }" < $DB
;;
name)
awk -F\| "\$2==\"$call\" { print \$3 }" < $DB
;;
qth)
awk -F\| "\$2==\"$call\" { print \$4 }" < $DB
;;
*)
awk -F\| "\$2==\"$call\" { print }" < $DB
;;
esac
These two scripts work together to have RUMlogNG pull SKCC data when you enter a call sign. `get_skcc` gets put in a directory, and you need to mark it as executable (`chmod +x get_skcc`). You'll also need to update the Applescript file to point to it, as it currently points to `/Users/sean/bin/get_skcc` which is almost certainly wrong for you.
The .scpt file can be run from within the script editor (double click on the script, it should be the default action). You can also export it as an application and run the application.
Running the script will open RUMlogNG. If you close RL before this script, it'll restart RL, so you'll want to kill off this script when you're done.
I have the 4th user field set aside for SKCC numbers, so in Line 13 you can change that if you use a different one, or delete it entirely if you don't want to track it. One thing to note is that RL currently doesn't know about the SKCC data type, so when you go to apply for an award by exporting the QSOs to ADIF, you'll need to do a search and replace for that field and change it to "skcc".
set lastCall to ""
repeat
tell application "RUMlogNG"
set currentCall to callsign
if (lastCall is not equal to currentCall) then
set lastCall to currentCall
set skcc_nr to do shell script "/Users/sean/bin/get_skcc " & currentCall & " nr"
set their_name to do shell script "/Users/sean/bin/get_skcc " & currentCall & " name"
if skcc_nr is not "" then
set nick to their_name
set qth to do shell script "/Users/sean/bin/get_skcc " & currentCall & " qth"
set note to "SKCC: " & skcc_nr & "|" & their_name
set userField_4 to skcc_nr
end if
end if
end tell
delay 1
end repeat
@swalberg
Copy link
Author

get_skcc goes somewhere like ~/bin and is marked as executable (chmod +x get_skcc from the terminal). Open script editor and paste in the script, updating the path to get_skcc. If you want you can File -> Export this to an app and click on it. It'll open up RumlogNG for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment