-- Show dialog box local dialog = finenv.UserValueInput() dialog.Title = "Move TAB Numbers" dialog:SetTypes("Number") dialog:SetDescriptions("Move x strings downwards:") dialog:SetInitValues(1) local dlgresult = dialog:Execute() if not dlgresult then return end local stringadd = dlgresult[1] -- Browse through the note entries in the selection: local tabinstrument = finale.FCFretInstrumentDef() for entry in eachentrysaved(finenv.Region()) do local staffspec = finale.FCCurrentStaffSpec() if staffspec:LoadForEntry(entry) and staffspec:IsTablature() then if tabinstrument:Load(staffspec.FretInstrumentDefID) then for note in each(entry) do local mod = finale.FCTablatureNoteMod() if mod:LoadAt(note) then -- Calculated the MIDI offset difference between the strings: local originalstring = tabinstrument:GetStringTuning(mod.StringNumber) local otherstring = tabinstrument:GetStringTuning(mod.StringNumber + stringadd) local midioffset = originalstring - otherstring -- Transpose: local newmidipitch = note:CalcMIDIKey() - midioffset note:SetMIDIKey(newmidipitch) -- Change the string: mod.StringNumber = mod.StringNumber + stringadd -- Save the new string number: mod:Save() end end end end end