Pitch Report plugin is progressing well – thanks for the help Steve!
I’m selecting all 12 tracks and running the PitchReport plugin.
The first time the plugin is run it looks for the existence of a PitchReport property on SCRATCH and if not found creates it with a value of t and prints a project header.
All the subsequent 11 invocations skip printing the project header.
The problem occurs if I run the plugin again. The PitchReport property on SCRATCH is still set.
Is there a way the plugin can tell when it is invoked on the last track? If so I could then remove the property then.
If not I’ll probably need to create a separate plugin just to remove that property.
selection has a tracks property that contains a list of track numbers selected I’m saving the length of this list as a SCRATCH property named pitch-report-track-count and incrementing another property named pitch-report-track-number every time the plugin is invoked.
After the plugin has finished an invocation I check if track-number = track-count. If so the plugin is processing the last track and removes the pitch-report-* properties from SCRATCH.
This allows the plugin to generate a correct report when re-run with different initial settings as well as after updates to the plugin code.