DESTRUCTIVE! resets all Notes to zero-length string ""
Best for
Code
-- Note remove all Notes V1.0
--
-- DESTRUCTIVE! resets all Notes to zero-length string ""
--
-- by gramps (John McLeod)
-- V1.0 -- August 14, 2012
--
progname = "Note remove all Notes V1.0"
--
function BFG() -- resets all the Notes
for i=1,structure.GetCount() do
structure.SetNote(i, "")
end
end -- function BFG
--
-- MAIN stuff
--
print(progname,"started")
--
local ask = dialog.CreateDialog("reset all Notes")
ask.Instructions = dialog.AddLabel("press OK to PERMANENTLY REMOVE ALL Notes!")
ask.OK = dialog.AddButton("OK", 1)
ask.Cancel = dialog.AddButton("Cancel", 0)
if (dialog.Show(ask) > 0) then
BFG() -- reset all the Notes
print("all Notes have been reset to \"\"")
else
print("user canceled operation, Notes retained")
end
--
print(progname,"ended")
--
-- end Note remove all Notes V1.0