Skip to content

Commit

Permalink
Merge pull request #153 from notengrafik/pr/check-if-score-exists
Browse files Browse the repository at this point in the history
Make sure we have an active score
  • Loading branch information
ahankinson authored Jun 15, 2020
2 parents ddef818 + eafbdff commit 9fbda8a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Run.mss
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,18 @@ function DoExport (filename) {
Self._property:libmei = libmei4;
libmei.destroy();

// Deal with the Progress GUI
// set the active score here so we can refer to it throughout the plugin
Self._property:ActiveScore = Sibelius.ActiveScore;
if (Self._property:ActiveScore = null)
{
Sibelius.MessageBox('Could not find an active score. Cannot export to ' & filename);
return false;
}

// Set up the warnings tracker
Self._property:warnings = CreateSparseArray();

// Deal with the Progress GUI
progCount = Sibelius.ActiveScore.SystemStaff.BarCount;
fn = utils.ExtractFileName(filename);
progressTitle = utils.Format(_InitialProgressTitle, fn);
Expand Down

0 comments on commit 9fbda8a

Please sign in to comment.