Pick Band for FT8 Frequency

Description

A list of frequency bands is presented from 160 meters to 6 meters. Run the routine, select a band in the provided list, and that FT8 frequency is entered into the MacLoggerDX QSO frequency field.

property freqList : {“1.840.00”, “3.573.00”, “7.074.00”, “10.136.00”,
“14.074.00”, “18.100.00”, “21.074.00”, “24.915.00”, “28.074.00”,
“50.313.00”}
property bandList : {“160”, “80”, “40”, “30”, “20”, “17”, “15”, “12”,
“10”, “6”}

try
set myChoice to choose from list bandList with prompt “Select the
frequency band:” with title “Frequency Band Query”
set myChoice to myChoice as string
set userCanceled to false
on error number -128
set userCanceled to true
end try
if userCanceled = true then
tell application “MacLoggerDX” to activate
else
set bandIndex to indexOfStringInList(myChoice, bandList)
set theFrequency to item bandIndex of freqList
tell application “MacLoggerDX”
activate
set LogFrequency theFrequency
end tell
end if

on indexOfStringInList(targetItem, aList)
set i to 1
repeat with aItem in aList
considering case
set compareResult to (aItem as string = targetItem as string)
end considering
if compareResult is true then
return i
end if
set i to i + 1
end repeat
return missing value
end indexOfStringInList