I have a script that requires multiple selections.Which were working until I wrote an instruction for the end results to be returned with multipliers. Since the new line was added the script will only process a single selection from the list.
I’d be extremely grateful for any input.
property twelfth_root_2 : (2 ^ (1 / 12))
set fRoot to text returned of (display dialog "Choose fundemental frequency in Hertz" default answer "")
set presets to {"b9", "9th", "m3", "3rd", "4th", "Dim5", "5th", "Aug5", "6th", "7th", "m7", "Oct"}
set theMode to (choose from list presets with prompt "Choose a character:" with multiple selections allowed)
if theMode is false then return -- user cancelled
set PresetNumber to 1
repeat with EachPreset in presets
if theMode as string = EachPreset as string then
exit repeat
else
set PresetNumber to PresetNumber
end if
end repeat
set semitones to PresetNumber
set frequencies to {}
set frequency to fRoot * (twelfth_root_2 ^ semitones)
set frequency to (round (frequency * 100)) / 100
set end of frequencies to frequency -- or to frequency as text.
set frequencies to {frequencies & frequencies / 2, frequencies * 2, frequencies * 4, frequencies * 8, frequencies * 16, frequencies * 32, frequencies * 64}
return frequencies