{ Initialize "() { AddToPluginsMenu(_PluginMenuName,'Run'); dlg_fFirstTime = True; }" _PluginMenuName "Run Plugin On Folder Of Scores" _ScoreError " requires an open score that has been previously saved, and has at least one staff. Please open a score or save the current score (the name must not start with 'untitled'), then run the plugin again." g_fDoTrace "false" _select_something "There is no valid passage selection, so do you want this operation to apply to the whole score?" _VersionText "Version " _msgVersionTooEarly "This plug-in requires Sibelius 6.2 or later." _msgNumProcessed "Number of scores processed = " _msgScoreNoStaves "This score contained no staves and was not processed: " _HelpTitle " Help" zg_Sib62Version "6200" _msgNoOpenScores "There are currently no open scores, so none can be processed." g_fDoOpenScores "false" Run "() { // This program has been donated to the public domain. // All the routines may be used freely in other plugins without attribution // To use this template you will need to make at least the following changes: // * Change _PluginMenuName and the file name // * Edit _InitialDialogText, and either remove the Help Button or edit _HelpText. Note that HelpText contains some programmer information. // * Change the code in ProcessScoreNoSaveClose so it does what you want for a single score. // * If you want to change the save or close options, look in ProcessActiveScore, ProcessOpenScores, and ProcessFolderOfScores // * Add validation code to ValidateDialog. Emit a message and return False for an error and the dialog will stay up // All the other code should not need to be changed. InitialDialog will take its title from _PluginMenuName. // This plugin uses the routine CloseQuietly to close scores opened on ProcessFolderOfScores without asking to save changes (Fixed Close(False) bug). if (Sibelius.ProgramVersion < zg_Sib62Version) { MyMessageBox(_msgVersionTooEarly); return False; } // update zg_VersionNumber when changes are made. dlg_Version = BuildVersionText(zg_VersionNumber); g_strFolderOfScores = ''; g_fDoFolderFromDialog = False; g_fDoOpenScores = False; // * code to save and sestore dialog settings to the plugin Preferences database by callin ght eplugin //* if available // ******* The calls to preferences code starts here // AddPluginPreferencesLib lets you set up plugin preferences with minimal code needed fWarnIfPluginMissing = True; // will report error is plugin is not installed fFirstTime = 0 + dlg_fFirstTime; pPlugin = GetAddPluginPreferencesLib(fWarnIfPluginMissing, fFirstTime); // warn first time in session only fPreferencesAvailable = (pPlugin != null); fTracePreferences = False; // set True if you have Preferences issues valVersion = '' & zg_VersionNumber; if (fPreferencesAvailable) { arsParametersPreferences = CreateSparseArray(); SetUpPreferencesData(pPlugin, arsParametersPreferences, fTracePreferences); // on error, arsParametersPreferences.Length will be 0 fPreferencesAvailable = (arsParametersPreferences.Length != 0); if (fPreferencesAvailable) { okGetPrefs = pPlugin.API_GetPreferences(('' & _PluginMenuName), valVersion, arsParametersPreferences, fTracePreferences); } } // Dialog specific code is in this block ********************************************************* Sibelius.EnableControlById(Self, InitialDialog,'IDC_CURRENT_SCORE_BUTTON', (Sibelius.ScoreCount != 0)); Sibelius.EnableControlById(Self, InitialDialog,'IDC_OPEN_SCORES_BUTTON', (Sibelius.ScoreCount != 0)); if (dlg_fFirstTime) { dlg_fSaveScores = False; dlg_strPlugin = ''; // can't set list box sel to blank in Sib 7+ so will default to first entry dlg_strFindInList = ''; } dlg_fFirstTime = False; SetUpPluginList(); ok = DoDialog(InitialDialog); if (ok = False) { return False; } if (fPreferencesAvailable) { okSavePrefs = pPlugin.API_SavePreferences(('' & _PluginMenuName), valVersion, arsParametersPreferences, fTracePreferences); } // ************************************ End dialog specific block // If retrofitting this plugin to run a single plugin, you can skip the dialog code, possibly replacing a dialog if you want different options. // You will want to have g_fDoFolderFromDialog and g_fDoOpenScores set if you want to process anything but the current score. // set dlg_strPlugin to be the plugin filename without path or extension. ProcessFolderOfScores will find a folder for you and hagle the individual // passing of scores to the plugin. The plugin is actually called in ProcessScoreNoSaveClose. pList = Sibelius.Plugins; nameFilePlugin = GetPlugin(pList, dlg_strPlugin); if (nameFilePlugin != -1) { pPlugin = @nameFilePlugin; } else { MyMessageBox(_msgPluginNotFound & dlg_strPlugin); return False; } numProcessed = 0; if (g_fDoFolderFromDialog) { numProcessed = ProcessFolderOfScores(pPlugin); } else { if (Sibelius.ScoreCount = 0) { MyMessageBox( _msgNoOpenScores); return False; } if (g_fDoOpenScores) { //trace('calling ProcessOpenScores'); numProcessed = ProcessOpenScores(pPlugin); } else { //trace('calling ProcessActiveScore'); numProcessed = ProcessActiveScore(pPlugin); } } if (dlg_fTraceNumScores) { if (numProcessed > 0) { trace(' '); } trace(_msgNumProcessed & numProcessed); } return True; }" DoTrace "(string) { // flagged version of trace if (g_fDoTrace = True) { trace('***' & string); }}" MyMessageBox "(string) { Sibelius.MessageBox(_PluginMenuName & ': ' & string); }" _Processing "Processing..." BuildVersionText "(versionNumber) { // this assumes that versionNumber is of the form // Major version (2 digits) & Minor Version (2 digts) & Patch (2 digits) // it builds up text version of the version number so only a single value needs to be updated str = '' & versionNumber; vText = _VersionText & Substring(str, 0, 2) & '.' & Substring(str, 2, 2) & '.' & Substring(str, 4, 2); return vText;}" Version "() { // this is a version number that can be compared numerically, of the form // Major version (2 digits) & Minor Version (2 digts) & Patch (2 digits) return 0 + zg_VersionNumber; }" _NumProcessed "Number of objects processed = " zg_VersionNumber "026001" DoHelp "() { HelpDialog.Title = '' & _PluginMenuName & _HelpTitle; ok = Sibelius.ShowDialog(HelpDialog, Self); return ok;}" HelpDialog "Dialog" { Title "Run Plugin On Folder Of Scores Help" X "276" Y "143" Width "374" Height "347" Controls { Text { Title X "4" Y "22" Width "364" Height "299" RightAlign "0" Value "_HelpText" Method ID "IDC_THIS_PLUGIN_COUNTS_STATIC" SetFocus "0" } Button { Title "Close" X "4" Y "4" Width "56" Height "14" DefaultButton "1" Value Method SetFocus "1" ID "IDC_OK_BUTTON" EndDialog "1" } } } _HelpText "This plugin will run a plugin, telling it to process the active score, all open scores, or the scores contained in a specified folder. There are a few issues you should be aware of, especially when processing scores that are already open. 1. What is the selection passed to the called plugin? * If a score is opened by this plugin when processing a folder of scores, the entire score is always selected. If the score was already open, it will also be fully selected by default. If you uncheck ''Fully select scores already open'', the selection that was active in the score will be retained, and given to the called plugin. 2. Should processed scores be saved by this plugin? * By default scores processed will not be saved, but ''Save scores after plugin is run'' will cause all processed scores to be saved. 3. Should scores opened by this plugin be closed? * Scores that were open before this plugin is run will not be closed. If this plugin opens the score while processing a folder of scores, it will be closed if ''Close scores opened here'' is checked. 4. Should the called plugin process the active part for the score or the full score? * Before Sibelius 7, if a plugin opened a score it always got the full score. Since Sibelius 7, it will get the part that was active when the score was last closed. By default, the called plugin will be given the active part, which might be the full score or a dynamic part. You can choose to pass the full score instead of the active part, either always, or only when the score was opened by this plugin when processing a folder of scores. * If you choose ''Process Full score if opened here'', any scores that were not open before the plugin was run will present the Full score to the called plugin. Any scores already opened will present the currently active part. You can force all scores to be the full score by choosing ''Process Full score always''. 5. Can you stop the called plugin from putting up its dialog on every score? * If a called plugin puts up a dialog every time it is run, then you will see that dialog for every score that is processed. This plugin has no control over that. Some plugins have the ability to hide the dialog after the first time they are used, to allow you to set options and use those options for all following scores. Those work well when called here. If the plugin does not have that option, you will need to click OK many times or modify the plugin to be able to hide its dialog. Even with hitting OK, it should still be faster than running the plugin manually for each score in a folder." FolderDialog "Dialog" { Controls { Button { Title "Cancel" X "145" Y "87" Width "56" Height "14" DefaultButton "0" Value Method SetFocus "0" ID "IDC_CANCEL_BUTTON" EndDialog "0" } Button { Title "OK" X "208" Y "87" Width "56" Height "14" DefaultButton "1" Value Method "DoBrowse" SetFocus "1" ID "IDC_OK_BUTTON" EndDialog "1" } Text { Title X "4" ID "IDC_FOLDER_TEXT" Y "4" Width "254" Height "72" RightAlign "0" Value "_FolderText" Method SetFocus "0" } } Title "Process Folder of Scores" X "505" Y "257" Width "270" Height "125" } _FolderText "Click OK to select and process a folder of Sibelius scores." g_strFolderOfScores DoBrowse "() { ReopenDialog = True; while (ReopenDialog = True) { folderMain = Sibelius.SelectFolder (_ChooseFolder); ReopenDialog = False; fObject = IsObject (folderMain); if (fObject = True and folderMain.Type = 'Folder') { g_strFolderOfScores = folderMain.Name; if (g_strFolderOfScores = '') { MyMessageBox(_NoneFound & folderMain.Name); ReopenDialog = True; //try again } else { numFiles = folderMain.FileCount ('SIB'); if (numFiles > 0) { //trace('Number of sib files found: ' & numFiles); return True; } else { MyMessageBox(_NoneFound & folderMain.Name); g_strFolderOfScores = ''; ReopenDialog = True; //try again } } } else { return False; // most likely cancel } } }" _ChooseFolder "Please select a folder containing Sibelius scores." DoFolderFromDialog "() { g_fDoFolderFromDialog = True;}" g_fDoFolderFromDialog "false" InitialDialog "Dialog" { Title "Run Plugin On Folder Of Scores - Version 02.60.00 - by Bob Zawalich" X "308" Y "128" Width "299" Height "360" Controls { Text { Title X "4" Y "4" Width "288" Height "98" RightAlign "0" Value "_InitDialogText" Method ID "IDC_INITIAL_TEXT" SetFocus "0" } Text { Title "Plugin to run:" X "20" Y "105" Width "47" Height "12" RightAlign "0" ID "IDC_PLUGIN_TO_RUN_STATIC" Value Method SetFocus "0" } Edit { Title X "72" Y "105" Width "92" Height "12" ID "IDC_EDIT_FIND" Value "dlg_strFindInList" Method SetFocus "0" } Button { Title "Find Plugin" X "169" Y "104" Width "50" Height "14" DefaultButton "0" ID "IDC_FIND_PLUGIN_BUTTON" Value Method "DoFindInList" SetFocus "0" } ListBox { Title X "4" Y "119" Width "161" Height "199" ID "IDC_LISTALL" ListVar "dlg_lstPlugins" AllowMultipleSelections "0" Value "dlg_strPlugin" Method "ChangePluginList" SetFocus "1" } CheckBox { Title "Save scores after plugin is run" X "169" Y "120" Width "104" Height "12" ID "IDC_SAVE_SCORES_AFTER_CHECK" Value "dlg_fSaveScores" Method SetFocus "0" } CheckBox { Title "Close scores opened here" X "169" Y "134" Width "118" Height "12" ID "IDC_CLOSE_SCORES_OPENED_CHECK" Value "dlg_fCloseScoresIOpened" Method SetFocus "0" } CheckBox { Title "Fully select scores already open" X "169" Y "155" Width "104" Height "12" ID "IDC_FULLY_SELECT_OPEN_CHECK" Value "dlg_fFullySelectOpenScores" Method SetFocus "0" } CheckBox { Title "Trace score names" X "169" Y "169" Width "104" Height "12" ID "IDC_TRACE_SCORE_NAMES_CHECK" Value "dlg_fTraceScoreNames" Method SetFocus "0" } CheckBox { Title "Trace number of scores" X "169" Y "182" Width "104" Height "12" ID "IDC_TRACE_NUMBER_OF_CHECK" Value "dlg_fTraceNumScores" Method SetFocus "0" } GroupBox { Title "Process full score or part" X "166" Y "209" Width "118" Height "58" ID "IDC_PROCESS_FULL_SCORE_GROUP" Value Method SetFocus "0" } RadioButton { Title "Process active part" X "169" Y "223" Width "92" Height "12" StartGroup "1" ID "IDC_PROCESS_ACTIVE_RADIO" Value "dlg_fProcessActivePart" Method SetFocus "0" } RadioButton { Title "Process Full score always" X "169" Y "237" Width "103" Height "12" StartGroup "0" ID "IDC_PROCESS_FULL_SCORE_RADIO" Value "dlg_fProcessFullScoreAlways" Method SetFocus "0" } RadioButton { Title "Process Full score if opened here" X "169" Y "251" Width "109" Height "12" StartGroup "0" ID "IDC_PROCESS_FULL_SCORE_RADIO2" Value "dlg_fProcessFullScoreIOpen" Method SetFocus "0" } Button { Title "Help..." X "177" Y "304" Width "50" Height "14" DefaultButton "0" ID "IDC_HELP_BUTTON" Value Method "DoHelp" SetFocus "0" } Button { Title "Cancel" X "234" Y "304" Width "56" Height "14" DefaultButton "0" Value Method SetFocus "0" ID "IDC_CANCEL_BUTTON" EndDialog "0" } Button { Title "Current Score" X "33" Y "320" Width "80" Height "14" DefaultButton "0" Value Method SetFocus "0" ID "IDC_CURRENT_SCORE_BUTTON" EndDialog "1" } Button { Title "All Open Scores" X "123" ID "IDC_OPEN_SCORES_BUTTON" Y "320" Width "80" Height "14" DefaultButton "0" Value Method "DoOpenScores" SetFocus "0" EndDialog "1" } Button { Title "Process Folder..." X "212" Y "320" Width "80" Height "14" DefaultButton "1" Value Method "DoFolderFromDialog" SetFocus "0" ID "IDC_PROCESS_FOLDER_BUTTON" EndDialog "1" } } } _InitDialogText "Choose a plugin to run against the current score, all currently open scores, or a folder of scores. *** If you want a processed score to be saved, be sure to check the ''Save scores'' box. By default any scores opened by this plugin will be closed, but scores that were already open will not be closed. All scores opened by this plugin when processing a folder will be fully selected before the called plugin is run. The last plugin run in a Sibelius session will appear at the top of the plugin list next time. The plugin that is run will usually put up a dialog on each file processed; you may need to edit the plugins being run to avoid that." dlg_strEditFolderDest DestinationDialog "Dialog" { Controls { Button { Title "Cancel" ID "IDC_BUTTON3" X "279" Y "38" Width "56" Height "14" DefaultButton "0" Value Method SetFocus "0" EndDialog "0" } Button { Title "OK" ID "IDC_BUTTON2" X "341" Y "38" Width "56" Height "14" DefaultButton "1" Value Method SetFocus "0" EndDialog "1" } Edit { Title ID "IDC_EDIT" X "5" Y "7" Width "311" Height "12" Value "dlg_strEditFolderDest" Method SetFocus "1" } Button { Title "Browse..." ID "IDC_BUTTON" X "321" Y "6" Width "66" Height "14" DefaultButton "0" Value Method "DoBrowseDest" SetFocus "0" } } Title "Choose destination folder (type new name to create folder)" X "223" Y "266" Width "407" Height "77" } _ChooseFolderDest "Please select a folder to contain exported files." DoBrowseDest "() { folderMain = Sibelius.SelectFolder (_ChooseFolderDest); strDestination = ''; fObject = IsObject (folderMain); if (fObject = True and folderMain.Type = 'Folder') { strDestination = folderMain.Name; if (Sibelius.ProgramVersion >= zg_Sib62Version) { if (Sibelius.FolderExists(folderMain.Name) = False) { folderMainNew = Sibelius.CreateFolder(folderMain.Name); fObject = IsObject (folderMainNew); if (fObject = True and folderMainNew.Type = 'Folder') { strDestination = folderMainNew.Name; } } } } if (strDestination != '') { dlg_strEditFolderDest = strDestination; } Sibelius.RefreshDialog();}" DoDialogDestination "(pathInit) { dlg_strEditFolderDest = pathInit; //trace('DDD initial path = ' & pathInit); ReopenDialog = True; g_fReopen = False; while (ReopenDialog = True) { if (Sibelius.ShowDialog(DestinationDialog,Self) = False) { return False; } if (g_fReopen = False) { folder = Sibelius.GetFolder(dlg_strEditFolderDest); if ((dlg_strEditFolderDest = '') or (folder = null) or (IsObject(folder) = False)) { MyMessageBox(_msgInvalidFolderDest); g_fReopen = True; } if (Sibelius.FolderExists(dlg_strEditFolderDest) = False) { ok = MyYesNoMessageBox(_msgCreateFolder & dlg_strEditFolderDest); if (ok = False) { g_fReopen = True; } } } if (g_fReopen = False) { ReopenDialog = False; } g_fReopen = False; } dlg_strEditFolderDest = GetTerminatedFolderName(TrimBlanks(dlg_strEditFolderDest, False)); return True; }" _NoneFound "There are no Sibelius scores in the chosen folder. Please select another folder." DoOpenScores "() { g_fDoOpenScores = True;}" ProcessOpenScores "(pPlugin) { numProcessed = 0; arsScoresOpen = CreateSparseArray(); // gather up the open scores now so that we will not pick up scores created by the plugins being run for each scoreOpen in Sibelius { arsScoresOpen.Push(scoreOpen); } for i = 0 to arsScoresOpen.Length { score = arsScoresOpen[i]; if (dlg_fFullySelectOpenScores) { score.Selection.SelectSystemPassage(1, score.SystemStaff.BarCount); // select all score } // turn to full score only if Always option chosen numProcessed = numProcessed + ProcessScoreNoSaveClose(score, pPlugin, (0 + dlg_fProcessFullScoreAlways)); // if you need to save or close, do it here (not typical - usually do not save or close open scores) if (IsValidOpenScore(score)) // called plugin may have already closed the score, so check its validity { if (dlg_fSaveScores) { DoSaveScore(score); // tests for previously unsaved score } // Sibelius.Close(False); } } return numProcessed; }" MyYesNoMessageBox "(string) { ok = Sibelius.YesNoMessageBox(_PluginMenuName & ': ' & string); return ok;}" DoDialog "(dialog) { //trace('DD dlg_strPlugin: (' & dlg_strPlugin & ')'); //g_fPluginSelected = False; // force a plugin to be actively selected ReopenDialog = True; g_fReopen = False; dialog.Title = '' & _PluginMenuName & ' - ' & dlg_Version & ' - ' & g_strAuthor; while (ReopenDialog = True) { if (Sibelius.ShowDialog(dialog,Self) = False) { return False; } if (ValidateDialog() = False) { g_fReopen = True; } if (g_fReopen = False) { ReopenDialog = False; } g_fReopen = False; } return True; }" g_fReopen "false" ValidateDialog "() { //('VD dlg_strPlugin: ' & dlg_strPlugin); // xxx it appears that the first item in a list will be selected even if no active sel is made for force a flag to be set when a change is made // I now put the last used name for a session at the top of the list. That way you can just hit OK and use it again // Previous in Sib 7 there was a disconnect between the name of the variable and the actulal listbox selection which // is always the first entry in the listbox. //if (g_fPluginSelected = False) //{ // MyMessageBox(_msgNoPluginSelected); // return False; //} return True;}" ProcessFolderOfScores "(pPlugin) { //trace('entering ProcessFolderOfScores'); // Proces scores, including open scores in the same order that the files come in ok = DoBrowse(); if (ok = False) { return 0; } if (g_strFolderOfScores = '') { return 0; } folder = Sibelius.GetFolder(g_strFolderOfScores); strFolder = GetTerminatedFolderName(folder.Name); numProcessed = 0; // progress bars can't be nested, so use the in-score ones instead // this version includes a progress bar for a folder. Remove here is the score handler does a progress bar numFiles = 0; arrIOpen = CreateArray(); // keep track of whether an entry is a file name or an open score for each SIB file in folder { iScore = IndexOfOpenScore(file.NameWithExt); // use this to make it easy to get at score for processing if (iScore != -1) { name = 'file' & numFiles; @name = iScore; } else // non-open score { name = 'file' & numFiles; @name = file; } arrIOpen[numFiles] = iScore; // -1 means not open score numFiles = numFiles + 1; } // By default neither save nor close open scores, as we do processing the current and open scores // an alternative would be to not process open scores at all. To do that just comment out this block //trace('ProcessFolderOfScores: number of open scores to process: ' & numOpenScoresToProcess); Sibelius.CreateProgressDialog(_PluginMenuName, 1, numFiles); for i = 0 to numFiles { progress = i + 1; fContinue = Sibelius.UpdateProgressDialog(progress, progress & ' / ' & numFiles); if (fContinue = False) { Sibelius.DestroyProgressDialog(); return numProcessed; } fAlreadyOpen = (arrIOpen[i] != -1); if (fAlreadyOpen) // score was previously open { iScore = 0 + arrIOpen[i]; score = Sibelius.NthScore(iScore); if (dlg_fFullySelectOpenScores) { score.Selection.SelectSystemPassage(1, score.SystemStaff.BarCount); // select all score } // turn to full score only if Always option chosen numProcessed = numProcessed + ProcessScoreNoSaveClose(score, pPlugin, (0 + dlg_fProcessFullScoreAlways)); //trace(' ProcessFolderOfScores: opens score has been processed'); if (IsValidOpenScore(score)) // called plugin may have already closed the score, so check its validity { // if you need to save and close, do it here. Usually leave open scores unsaved and unclosed if (dlg_fSaveScores) { DoSaveScore(score); // tests for previously unsaved score } // Sibelius.CloseWindow(False); } } else { name = 'file' & i; // to avoid iterator change problem file = @name; //trace(' opening file: ' & file.NameWithExt); if (Sibelius.Open (file.NameWithExt, True) = True) // open quietly { // It will be the active score, so get hold of it score = Sibelius.ActiveScore; if (IsObject(score)) // should not need this but sometimes other files sneak through { score.Selection.SelectSystemPassage(1, score.SystemStaff.BarCount); // select all score // turn to full score if either Process Full option chosen, thus if not dlg_fProcessActivePart fProcessFullScore = (dlg_fProcessActivePart = False); numProcessed = numProcessed + ProcessScoreNoSaveClose(score, pPlugin, fProcessFullScore); // if you need to save, do it here. If score is not modified, just close it if (IsValidOpenScore(score)) // called plugin may have already closed the score, so check its validity { if (dlg_fSaveScores) { //trace('ProcessFolderOfScores saving score'); DoSaveScore(score); // tests for previously unsaved score; } // close latest score with no dialogs if (dlg_fCloseScoresIOpened) { fTraceClose = False; CloseQuietly(score, fTraceClose); } } //else //{ // trace('ProcessFolderOfScores score not valid after plugin call. Not saved or closed.'); //} } } } } Sibelius.DestroyProgressDialog(); return numProcessed; }" ProcessScoreNoSaveClose "(score, pPlugin, fProcessFullScoreOnly) { // NOTE: if the file is to be changed and saved, do NOT do the saving here. // The code that calls this will save and close the files as needed if (dlg_fTraceScoreNames) { trace(score.FileName); } if (score.StaffCount = 0) { MyMessageBox(_msgScoreNoStaves & score.FileName); return 0; } Sibelius.ActiveScore = score; // so the called plugin will use this score as the active score // prior to Sib 7, open always gave the full score, since Sib 7 open could give a part. // If the user chooses to open the full score, change it here and **do not restore ** the original part if (fProcessFullScoreOnly) { dyn = score.DynamicParts; score.CurrentDynamicPart = dyn[0]; // force to full score } score.Redraw = False; numProcessed = 1; //pList = Sibelius.Plugins; //nameFilePlugin = GetPlugin(pList, dlg_strPlugin); //if (nameFilePlugin != -1) //{ // pPlugin = @nameFilePlugin; //} //else //{ // MyMessageBox(_msgPluginNotFound & dlg_strPlugin); // return False; //} //trace('Run name: (' & strPlugin & ')'); pPlugin.Run(); score.Redraw = True; return numProcessed; }" ProcessActiveScore "(pPlugin) { score = Sibelius.ActiveScore; numProcessed = 0; if (dlg_fFullySelectOpenScores) { score.Selection.SelectSystemPassage(1, score.SystemStaff.BarCount); // select all score } // turn to full score only if Always option chosen numProcessed = numProcessed + ProcessScoreNoSaveClose(score, pPlugin, (0 + dlg_fProcessFullScoreAlways)); // if you need to save or close, do it here (not typical - usually do not save or close open scores) if (IsValidOpenScore(score)) // called plugin may have already closed the score, so check its validity { if (dlg_fSaveScores) { DoSaveScore(score); // tests for previously unsaved score //MyMessageBox('ProcessActiveScore: score saved. Check dirty.'); } // Sibelius.Close(False); } return numProcessed; }" IndexOfOpenScore "(filenameScore) { // return the NthScore index if the file is an open score, otherwise return -1. Needs Sib 6+ //trace('IOS filenameScore in: (' & filenameScore & ')'); for i = 0 to Sibelius.ScoreCount { scorenameOpen = '' & Sibelius.NthScore(i).FileName; //trace('IOS i, open score name: ' & i & ', (' & scorenameOpen & ')'); if (filenameScore = scorenameOpen) { //trace('IOS filename in, found name of open score, i: ' & filenameScore & ', ' & Sibelius.NthScore(i).FileName & ', ' & i); return i; } } return -1;}" GetPath "(score) { file = Sibelius.GetFile(score.FileName); return GetTerminatedFolderName(file.Path);}" TrimBlanks "(strOrig, fLeadingOnly) { // This removes all leading and trailing spaces from a string, and returns the stripped string if ((strOrig = '') or (strOrig = null)) { return ''; } strStrip = ''; lenOrig = Length(strOrig); strStrip1 = ''; // get leading spaces fContinue = True; i = 0; while (fContinue) { c = Substring (strOrig,i,1); if (c != ' ') { fContinue = False; } else { i = i + 1; } } strStrip1 = Substring (strOrig, i); if (fLeadingOnly) { return strStrip1; } lenStrip1 = Length(strStrip1); fContinue = True; i = lenStrip1 - 1; while (fContinue) { if (i < 0) { fContinue = False; } else { c = Substring (strStrip1, i, 1); if (c != ' ') { fContinue = False; } else { i = i - 1; } } } strStrip = Substring (strStrip1, 0, i + 1); // DoTrace('TrimBlanks string, pre-stripped string, stripped string, original length, stripped length = ' & strOrig & ', *' & strStrip1 & '*, *' & strStrip & '*, ' & lenOrig & ', ' & Length(strStrip)); return strStrip;}" dlg_Version "Version 02.60.00" SetUpPluginList "(pList) { // updated to allow the first entry to be the last chosen plugin in this session. Initially the first Run sets dlg_strPlugin tp blank. // What we want here, for a non-blank dlg_strPlugin is to make it be the first entry in the list box, which is what Sib wants to // select. So at the end of this routine dlg_strPlugin will be what // it was and that entry will be the first in the list, or // dlg_strPlugin will be set to the value of the first entry in the list. pList = Sibelius.Plugins; strPluginFirst = ''; nameFilePlugin = GetPlugin(pList, dlg_strPlugin); // see if this string is an installed plugin if (nameFilePlugin != -1) { strPluginFirst = '' & dlg_strPlugin; } SetupPaths(); dictDup = CreateDictionary(); dictForSort = CreateDictionary(); pList = Sibelius.Plugins; for each p in pList { strName = p.Name; if (strName != '') { fNoDup = CheckDuplicates(p, dictDup); if (fNoDup) { if (strName != strPluginFirst) // nonblank strPluginFirst will not be put in dict { dictForSort[strName] = 'Y'; } } } } //trace('Run g_strPathShipPlugins, g_strPathUserPlugins, dictForSort: ' & g_strPathShipPlugins & ', ' & g_strPathUserPlugins & ', ' & dictForSort); arrToShow = CreateArray(); // Putting the last name first matches up the actual listbox selection with the name // so the plugin most recently run in this Sib selection will be selected and at the top of the list if (strPluginFirst != '') { arrToShow[0] = strPluginFirst; // last used plugin in this sib session goes to the top of the list and will be selected } for each Name name in dictForSort // use dict to sort names { if (dictForSort[name] = 'Y') { arrToShow[arrToShow.NumChildren] = name; //trace('SUPL name: ' & name); } } dlg_lstPlugins = arrToShow; dlg_strPlugin = '' & arrToShow[0]; // first entry in list will be selected. Will be previously run plugin if available }" CheckDuplicates "(p, dictDup) { // find the shipping plugin path // REVIEW does not work yet. If it finds a subfolder, which it will, the path will include the subfolder. Need to strip off part after Plugins if (g_strPathShipPlugins = '') { strPathBase = Substring(p.File.Path, 0, g_lenPathUserPlugins); if (strPathBase != g_strPathUserPlugins) { g_strPathShipPlugins = p.File.Path; g_lenPathShipPlugins = Length(g_strPathShipPlugins); } } if (dictDup[p.Name] = null) { dictDup[p.Name] = p.File.NameWithExt; return True; } else { if (dlg_fFirstTime) { trace(p.Name & _msgDuplicate1 & '\n' & p.File.NameWithExt & '.\n' & _msgDuplicate3 & '\n' & SetupFilename(dictDup[p.Name])); trace(' '); } return False; } }" DoRunRecent "() { dlg_fRunRecent = True; }" dlg_fRunRecent "false" _msgDuplicate1 " was found in multiple locations, most recently: " _msgDuplicate2 " whenever that name is chosen, the file name of the plugin that will run is: " GetPlugin "(pList, strPlugin) { for each p in pList { strName = p.Name; if (strName = strPlugin) { nameFile = p.File.NameNoPath; return nameFile; } } return -1;}" SetupFilename "(filename) { // strip off the base path (up to 'plugins') and leave the rest. Could be ship or user plugins return filename; //NYI }" g_strPathUserPlugins "C:\Users\Robert\AppData\Roaming\Avid\Sibelius\Plugins\" g_strPathShipPlugins "C:\ProgramData\Avid\Sibelius\Resources\en.lproj\Plugins\Accidentals\" g_lenPathShipPlugins "68" g_lenPathUserPlugins "54" SetupPaths "() { g_strPathUserPlugins = GetUserSibFolderName() & _strPlugins & Sibelius.PathSeparator; g_lenPathUserPlugins = Length(g_strPathUserPlugins); g_strPathShipPlugins = ''; // unavailable until we look at list. Will be set in CheckDuplicates g_lenPathShipPlugins = 0;}" GetUserSibFolderName "() { if (Sibelius.ProgramVersion >= zg_Sib7Version) { return utils.GetUserSibFolderName(); } // as of 4/15/05, this only give you // ....\username\Application Data\ // but we need // ....\username\Application Data\Sibelius Software\Sibelius n\ where n is the main Sib version number // Note clever dave budde/h-c trick of round instead of round down. this works for beta if initial minor version >= 500 strSibVersionMain = Round((Sibelius.ProgramVersion + 500) / 1000); // trace('GetUserSibFolderName strSibVersionMain = ' & strSibVersionMain); strPath1 = Sibelius.GetUserApplicationDataFolder().Name; strPath2 = GetTerminatedFolderName(strPath1); // ensure terminator. Needed for OSX strPath3 = strPath2 & _strSibSoftware & Sibelius.PathSeparator & _strSib & strSibVersionMain & Sibelius.PathSeparator; return strPath3;}" GetTerminatedFolderName "(strFolderName) { len = Length(strFolderName); ch = CharAt(strFolderName, (len - 1)); // last char in string if (Sibelius.PathSeparator != ch) { strFolderName = strFolderName & Sibelius.PathSeparator; } return strFolderName;}" _strPlugins "Plugins" _strSibSoftware "Sibelius Software" _strSib "Sibelius " zg_Sib7Version "7130" dlg_fFirstTime "true" dlg_lstPlugins { "12-Tone Matrix" "12-Tone Matrix2" "About Dolet 6 for Sibelius" "Add Accidentals to All Notes" "Add Accidentals to All Notes Multi Select" "Add Accidentals to All Sharp and Flat Notes" "Add Articulations To Notes" "Add Bar Before Special Barline" "Add Bar Number Changes For Rehearsal Marks" "Add Bar Rests In Empty Voices" "Add Brackets To Reprise Script" "Add Brass Fingering" "Add Brass Mutes_Bob" "Add Brass Mutes_Bora" "Add Capo Chord Symbols" "Add Capo Chord Symbols (Fixed)" "Add Capo Chord Symbols Mod 1" "Add Chord Notes Below Melody" "Add Chord Symbols" "Add Circled Number Symbols To Notes" "Add Continuous Control Changes" "Add Cresc Dim Lines" "Add Drum Pattern" "Add Dynamics From Live Playback" "Add Fake Barline to Bars" "Add Ficta Above Note" "Add Fingering To Notes" "Add Fingering To Notes For Sibelius 7+" "Add Harp Pedaling" "Add Hit Point Staff" "Add Interval" "Add Interval Diatonic 10th Down" "Add Interval Diatonic 10th Up" "Add LV Symbols To Notes" "Add LV Symbols To Notes Debug" "Add LV Tie To Untied 200 Pct Play" "Add Note Names" "Add Note Names To Noteheads" "Add Note Names To Noteheads White" "Add NotePerformer Guitar Effects MIDI Message" "Add NotePerformer Orchestral Tuning MIDI Message" "Add NotePerformer Pipe Organ & Accordion Stops MIDI Message" "Add NotePerformer Tenuto Always MIDI Message" "Add NotePerformer Vibrato Amount MIDI Message" "Add NotePerformer Vibrato Speed MIDI Message" "Add NotePerformer a2, a3, ... MIDI Message" "Add Notehead Names Graphics" "Add Notes to Tuplet" "Add One Symbol Per Beat" "Add Pickup Bar" "Add Pickup Bar With Deleted Rests" "Add Pipe Ornaments" "Add Pipe Ornaments 2" "Add Pitch Class To Notes" "Add Recorder Fingerings" "Add Rehearsal Mark Plus Double Barline" "Add Rehearsal Marks At Intervals" "Add Rehearsal Marks to Double Barlines" "Add Schenkerian Scale Degrees" "Add Simple Click Track" "Add Simple Harmony" "Add Slash Noteheads for Parts" "Add Slurs to Lyrics" "Add String Fingering" "Add Tonic Sol-Fa" "Add True LV Ties" "Add Verse Numbers" "Add or Replace System Text" "Adjust Fake Lyric Hyphen" "Adjust Grace Note Stem Lengths" "Adjust Grace Note Stem Lengths 105" "Adjust Start Repeat Barline" "Adjust Stem Lengths" "Adjust Text Lyrics Verse Numbers" "Align Lyrics" "Align Notes" "Align Objects To Barline" "Align To Beat" "All Symbols Labeled" "Alternate Harp Pedaling" "Alternate Picking" "Analyze Harmonic Intervals" "Analyze Melodic Intervals" "Apply Color To Text In Style" "Apply Key Signature To Selection" "Apply Named Color" "Apply Shape Notes" "Are Your Plugins Up-To-Date?" "Arpeggiate Chords" "Arpeggio Offsets" "Arrange Brass Voicings" "Arrange Voicings" "Attach Grace Notes To Hidden Rest" "Augment Intervals" "Backup Plug-in for Developers" "Bagpipe Drone" "Bagpipe Notation Repair" "Barline Tool" "Barnum First Last In System" "Barnum System End" "Batch Transpose" "Batch Transpose 12 Keys" "Batch Transpose Bass Clef" "Beam 3 Eighths In Common Time" "Beamed Note Groups" "Bookmark" "Boomwhacker® Note Colors" "Box Line Fixed Width" "Bracket Chord Symbols" "Bracket Expression Text" "Bracket Notes" "Bracket Text" "Breaks" "Browse Selected Objects" "Build House Style Lists" "Build Manuscript Papers" "Build Text Style Lists" "Calculate Statistics" "Capo Notation" "Cautionary Time Signatures" "Center Lyrics" "Change Case" "Change Duration NoteRest" "Change Dynamics" "Change Note Rest Duration" "Change Selected Barlines" "Change Split Point" "Change Text Accidental Size" "Change Tuplet Ratio" "Check Attachments" "Check Clefs" "Check Cues" "Check First Species Counterpoint" "Check Harp Pedaling" "Check Lyrics Hyphenation" "Check Multiple Stops" "Check Pizzicatos" "Check Redundancies" "Check Repeat Barlines" "Check for Parallel 5ths/8ves" "Chord Symbol No Bass" "Chord Symbol No Superscript" "Chord Symbols As Fractions" "Chord Symbols As Polychords" "Chord Symbols For Sib5 Export" "Chord To Voices" "Chords For Notes" "Chrom Diat Note Name Util" "Circle TAB Half & Whole Notes" "Clip Copy 1" "Clip Copy 2" "Clip Copy 3" "Clip Copy 4" "Clip Copy 5" "Clip Paste 1" "Clip Paste 2" "Clip Paste 3" "Clip Paste 4" "Clip Paste 5" "Clipboards" "Clone Focus Set" "Clone Score On Page" "Close All No Score" "Close All Parts" "Close All Windows" "Close Window All Scores" "Close Window Multiple" "Color Enharmonic Pitches" "Color Harp Strings" "Color Notes On String" "Color Notes On String Pre Sib 7" "Color Notes Test" "Color Picker" "Color Pitches" "Color Pitches With Noteheads" "Colored Notehead Data File" "Colored Noteheads On Harp Strings" "Colored Noteheads On Strings" "Combine Rests Empty Voices" "Combine Text Objects" "Combine Tied Notes and Rests" "Compare Numbers Failure" "Compare Sparse Arrays Note Props" "Compare Staves" "Consolidate Ossia Staves" "Convert Folder of MIDI Files" "Convert Folder of MusicXML Files" "Convert Folder of MusicXML Files Quiet" "Convert Folder of Scores to Current Sibelius Version" "Convert Folder of Scores to Earlier Sibelius Version" "Convert Folder of Scores to Graphics" "Convert Folder of Scores to MIDI" "Convert Folder of Scores to MusicXML" "Convert Folder of Scores to Web Pages" "Convert LV Symbols To LV Ties" "Convert Legacy Chord Symbols" "Convert Non Magnetic Glisses" "Convert Simple Time to Compound Time" "Convert Spaces To Units" "Convert Two Staves Piano" "Copy Articulations and Slurs" "Copy Double Note Values" "Copy Double Note Values Old" "Copy File" "Copy Halve Note Values" "Copy Notes As Grace Notes" "Copy Notes Only" "Copy Plugin" "Copy Signatures to New Score" "Copy Wildcard" "Count Braces In Plugin File" "Count Notes" "Counterpoint Intervals" "Create Add Line Plugin" "Create Add Text Plugin" "Create Add Text Plugin Sib 5" "Create All Instruments" "Create Blank Page" "Create Empty Text" "Create Insert Symbol Plugin" "Create Insert Symbol Plugin Test" "Create N by M Tuplet" "Create Notes With Triple Accidentals" "Create Scale Arrays" "Create Trailing Pseudo-Grace Notes" "Create Tuplet Different Units" "Create score database" "Cresc Dim Lines As Text" "Cresc./Dim. Playback" "Current Dynamics" "Custom Filter" "Custom Find" "Custom Note Filter" "Custom Simple Plugin" "Custom Simple Plugin Minimal" "Custom Staff Filter" "Custom System Filter" "Dangling Ties To Slurs" "Dave Speed Test" "Decrease Dynamics" "Decrease Passage Selection" "Delete Bar 1" "Delete Bars Move System Objects" "Delete Duplicate Text Lines Symbols" "Delete Duplicate Text Lines Symbols No Warn" "Delete Empty Staves" "Delete Empty Text Strings" "Delete Leading Empty Bars" "Delete Leading Or Trailing Empty Bars" "Delete Music Only" "Delete Pickup Bar" "Delete Rests Empty Voices" "Delete Selected Bar Objects" "Delete Selection" "Delete Special Normal Barlines" "Delete Title Page" "Delete User Editable Files" "Delete Versions from files in Folder" "Delete Voice 1" "Delete Voice 2" "Delete Voice 3" "Delete Voice 4" "Delete or Update Title Page" "Deselect Hidden Staves" "Diminish Intervals" "Disguise Score" "Display Accidentals In Selected Notes" "Display Bar Objects" "Distribute Live Start Positions" "Distribute Score Info" "Distribute Updated Plugin" "Divide Durations" "Dot Undot Rhythms" "Double Barline At Time Signature" "Double Note Values" "Draw Free Rhythm Barline" "Duplicates In Staves" "Dy From Note" "Edit Initial Instruments" "Edit Instrument Names" "Edit Part Instrument Names" "Edit Part Names" "Edit Text File" "Empty Staves" "Enumerate Named Colors" "Enumerate Note Styles" "Exchange Staff Contents" "Explode" "Explode Specific Staves" "Explode Staff To Parts" "Export All Versions" "Export Audio Score And Parts" "Export Audio With Count-In" "Export Bagpipe Audio" "Export Comments" "Export Doc Layout Style" "Export Each Instrument as MIDI" "Export Each Staff as Audio" "Export Folder of Scores As PDF" "Export Folder of Scores As PDF With Subfolders" "Export Folder of Scores In Multiple Formats" "Export Full Score PDF" "Export Import HS" "Export Lyrics" "Export Manuscript Paper Unchanged" "Export Midi or Audio with Standardised Settings" "Export MusicXML" "Export Scale NH Data Files" "Export Scores With No Parts" "Export Selected Text Chronological" "Export Selection As Audio" "Export Selection As Audio With Initial Play" "Export Selection As MIDI" "Export Selection As Score" "Export Text In Score" "Extend Hairpin" "Extend Slur" "Extract Parts From Folder of Scores" "Extract Positions" "Extract Tuplet Notes" "Figurenotes Colours" "File Name From Plugin Name" "Fill Score Info" "Fill Selection With Slash Notes" "Fill Up Pick-up Bar" "Fill With Tied Notes" "Filter All" "Filter All Except" "Filter By Accidentals" "Filter By Show Hide" "Filter Chord and Legacy Symbols" "Filter Colored Objects" "Filter Comments" "Filter Families" "Filter First Notes" "Filter Half Rests In 34 Time" "Filter Harp Pedal Changes" "Filter Harp Pedal Diagrams" "Filter Hidden Objects" "Filter Note Arpeggios Jazz Artic" "Filter Notes And Rests" "Filter Notes By String" "Filter Notes Tied To - Simple" "Filter Objects In Bar" "Filter Orphan Objects" "Filter Other" "Filter Slurred Notes - Simple" "Filter Stem Direction" "Filter System Objects" "Filter Technique At Start Of Bar" "Filter Text" "Filter Text Bob" "Filter Text By Length" "Filter What Was Chosen" "Filter With Deselect" "Find And Replace Multi-Filter" "Find Bar Number Change" "Find Colored Objects" "Find Comment Next" "Find Comment Previous" "Find Edited Shipping Plugins" "Find Enharmonic Pitch Next" "Find Enharmonic Pitch Previous" "Find Final Barline" "Find Highlights" "Find Intervals From Keys" "Find Irregular and Misfilled Bars" "Find Motive" "Find Next Final Barline" "Find Next One Of These" "Find Next System Object" "Find Note Arp Jazz Artic Next" "Find Note Arp Jazz Artic Previous" "Find Other" "Find Previous Final Barline" "Find Previous One Of These" "Find Previous Rehearsal Mark" "Find Range" "Find Range Plus 2" "Find Rehearsal Mark" "Find Start Of Movement" "Find Start Of Next Movement" "Find System Objects" "Find Text" "Find and Replace Rhythm" "Find and Replace Text" "FindNextNoteOrRest" "Fingering for Instruments" "Fit Selection To Time" "Fix PhotoScore Lyrics" "Fix TAB 5 String Banjo" "Fix TAB Collisions" "Fix Tied Note Live Playback" "Fixed Shortcuts" "Flip Selected Notes" "Flip Selected Notes No Dialog" "Flip Tie Symbols" "Flip Vertical Arrow Lines And Brackets" "Float Rests" "Focus Families" "Focus Families 1" "Focus Families 2" "Focus Families 3" "Focus Families 4" "Focus Families 5" "Focus Families 6" "Focus Families 7" "Focus Families 8" "Focus Families 9" "Focus Fretted" "Focus Keyboard" "Focus Other" "Focus Pitched Percussion" "Focus Pitched Percussion No Harp" "Focus Set" "Focus Set 1" "Focus Set 10" "Focus Set 2" "Focus Set 3" "Focus Set 4" "Focus Set 5" "Focus Set 6" "Focus Set 7" "Focus Set 8" "Focus Set 9" "Focus Singers" "Focus Strings" "Focus Strings Plus Harp" "Focus Unpitched" "Focus Wind" "Format BPM Text" "Format Tempo and Metronome Mark Text" "Fritts Transformation" "Gap Before Bar" "Generate Line Style Ids From Built In Names" "Generate MultiBar Tuplets" "Generate Quartertones" "German Chord Names" "Get Page Count" "Get Show State" "Get Sorted Part List" "Get Symbol Names" "Get User Folder Names" "Get Written Key Sig Data" "Go To" "Go To Comment" "Go To End Open Scores" "Go To Next Page" "Go To Out Of Range Note" "Go To Previous Page" "Go To Staff" "Go To Staff And Bar" "Go To Text" "GoTo Start Open Scores" "Grace note duration" "Groovy Music Markup" "Halve Note Values" "Harmonics Playback" "Harp Arpeggio" "Harp Diagram From Tuning" "Harp Gliss" "Harp Gliss From Pedal Diagram" "Harp Gliss Ian" "Harp Gliss Pitches" "Harp Gliss Playback" "Harp Gliss Playback 3" "Harp Gliss Playback2" "Harp Gliss and Octave Notes" "Hidden Instrument Change" "Hidden Key Signatures" "Hide All Voices Except 1" "Hide Articulations" "Hide Clef Add Symbol" "Hide Duplicate Rests" "Hide Empty Staves Grand Staff" "Hide In All" "Hide Rests In Voice" "Hide Show Invisible Noteheads" "Hide Specific Accidentals" "Hide Staves And Music" "Hide or Show Articulations" "Highlight Entire Selection" "Highlights To Comment Color" "House Style Fonts" "House Styles For Manuscript Papers" "Identify Selected Objects" "Identify Selected Symbols" "Import Colored Notehead Styles" "Import Document Layout Style" "Import Export Instruments" "Import House Style History" "Import House Style To Manuscript Paper" "Import House Style into Folder of Scores" "Impose Sketch onto Template" "Increase Dynamics" "Increment diatonic pitch" "Initial Key Signatures And Clefs" "Input Duration 128th" "Input Duration 16th" "Input Duration 2" "Input Duration 32nd" "Input Duration 64th" "Input Duration 8th" "Input Duration Half" "Input Duration Quarter" "Input Duration Whole" "Insert Bars With Multiple Time Signatures" "Insert Current Dynamics" "Insert Note or Rest" "Insert One Symbol" "Insert Symbol l.v. upCue 03M" "Install New Minimum Plugin" "Install New Plugin" "Install New Plugin Old" "Instrument List" "Instrument Types" "Inverse Select Notes" "Invert" "Invert Chords" "Invert Chords Down" "Invert Selected Bars" "Invert Selection" "Is Type Character" "J Hinchey Simple" "Jazz Flip from Guitar Bend Line" "LVFake" "Label Harp Pedal Diagrams" "Label Real Duration" "Layout Part Demo" "Left Align First Lyric In System" "Lengthen Tuplet" "Line Between Notes" "Line Between Notes 2" "Line Between Notes No Parts" "List Instruments In Score" "List Plugins" "List Plugins 2" "List Scale Tones" "Load Clipboard Presets" "Locate Colored Objects" "Lock or Unlock Score and Parts" "Log File Routines" "Loop Selection" "Lower Pitch Chromatically" "Lyrics To Expression Text" "Lyrics Verse Numbers And Alignment" "Lyrics Verse Numbers And Alignment Incorporate Num" "Make Into Tuplet" "Make Layout Uniform" "Make Page Count Even" "Make Piano Four Hands Layout" "Make Pitches Constant" "Make Triple Accidentals" "ManuScript Keystroke Demo" "Map Hide Empty Staves" "Map Pages" "Map Staves To Parts" "Map Timecodes To Bars" "Mark Enharmonic Pitches" "Maximize or Minimize Comments" "Merge Bars" "Merge To Voice 1" "Merge Tuplets" "Minimum Plugin" "Minimum Plugin Add Plug Pref" "Minimum Plugin Bare Bones" "Minimum Plugin Bob" "Minimum Plugin Buffer Trace" "Minimum Plugin Multi Scores" "Minimum Plugin Open Scores" "Minimum Plugin Preferences" "Misplaced Blank Page Text" "Move Pitches To Transposed Mid Line" "Move Selection Left" "Move Selection Right" "Move System Objects for Delete Bar" "Move Text To Blank Page" "Move Time Sig Repeat Barline" "Move or copy to another voice" "Move to Other Staff" "Multi Select List 2" "Multicopy Line" "Multicopy Object" "Multiple Selection To Passage" "Multirest Line" "Multirest Text" "Multirests and Empty Bars" "Mute Unmute" "My New Minimum Plugin" "My Plugins" "Narrow Two Voices" "Nashville Chord Numbers" "Nashville Chord Numbers Roman" "Negative Bar Number Change" "Notation from Live Playback" "Note Attached Arpeggio Offsets" "Note Attached Brackets" "Note Ranges for Selected Staves" "Note Spacing" "Notehead Style" "Number Bars" "Number Beats" "Number Multirest Bars" "Number Staff Names" "Open All Scores in Folder and Subfolders" "Open All Versions" "Open Folder Of Scores" "Open Folder Of Scores No Subfolder" "Open Full Score" "Open Score Full Score Only" "Open Selected Parts" "Open Selected Parts CheckBox" "Open Selected Parts Old" "Order And Print Parts From Multiple Scores" "Ornament Playback" "Page Numbers" "Page Size Score And Parts" "Paste Into Voice" "Paste To End Of Bar" "Pedal Lines" "Percussion Pitch Map" "Percussion Symbols As Text" "Pitch Counter" "Pitch Mapping" "Pitch Spectrum for Harp" "Pitch Values" "Play Again All Staves" "Play Again Selection" "Play It Again!" "Play Pipe Ornaments" "Players Required" "Plugin Descriptions" "Plugin Info" "Plugin Menu Name From Files" "Plugin Set" "Plugin With Bad Data" "Position Dynamics" "Position Rehearsal Marks" "PositionRehearsalMarksTextTooTry1" "Preferences" "Print Folder Of Scores And Parts" "Print Multiple Copies" "Proof-read" "Proportional Note Spacing" "Prune Plugin Preferences" "Quarter-tone Playback" "Quartertones With Semitone" "Raise Pitch Chromatically" "Randomize Pitches" "ReInput Text" "Realize Chord Symbols" "Reduce" "Reduce Staves To Full Score" "Rehearsal Recordings" "Rehearsal Recordings 2" "Rehearsal Recordings for Cloud Sharing" "Rehearsal marks RmText" "Remove All Coloring" "Remove All Highlights" "Remove Colored Noteheads" "Remove Coloring" "Remove Dangling Ties" "Remove Duplicate Hit Points" "Remove Duplicate Pitches" "Remove Final Tied Notes" "Remove Lyric Extension Lines" "Remove MIDI Pitch Bends" "Remove Named Noteheads" "Remove Notes from Tuplet" "Remove Overlapping Notes" "Remove Previous Ties" "Remove Rests" "Remove Selected Highlights" "Remove Text Line Feeds" "Remove Unison Notes" "Renotate Performance" "Repeat Notes Only" "Repeated Dynamics Text" "Replace Arpeggio Lines" "Replace Articulation Symbols" "Replace Color" "Replace Deleted Rests" "Replace Line Style" "Replace Parts With Defaults" "Replace Rests With Bar Rests" "Replace Symbol" "Reposition Dynamics" "Reposition Text" "Reset Mixer" "Reset Mixer for NotePerformer" "Reset Mixer for String Section" "Reset Position Independent" "Reset Rests In Parts" "Reset Spacing In Score and Parts" "Resize Bar" "Resize Symbols" "Respace Clef Change" "Respace Time Sig" "Respell Accidentals" "Respell Accidentals Allow Doubles" "Respell Accidentals Doubles Dialog" "Respell Chord Symbols" "Respell Flats as Sharps" "Respell For Wrong Clef" "Respell Sharps as Flats" "Respell To Match Score And Parts" "Respell Uncommon Accidentals" "Rest Pos Voices" "RestPosition" "Restore Edited Shipping Files" "Restore Plug-in for Developers" "Restore Tempo" "Retract Line Ends" "Retract Selection" "Retrograde" "Retrograde Pitches" "Retrograde Rhythms" "Retrograde Rhythms And Pitches" "Reverse Text" "Roman Numeral To Integer" "Rotate Pitches" "Rotate Rhythms" "Rotate Rhythms And Pitches" "Round Metronome Marks" "Rounding to 32nd Spaces" "Run Last Named Plugin" "Run Plug-ins" "Run Plugin On Folder Of Scores" "Run Plugin On Score And Parts" "Run Plugins By Name" "Run Windows Cmd" "Save All" "Save All Close All" "Save And Export" "Save And Export Debug" "Save Score With Date" "Save With Previous Version" "Save or Restore Selection" "Save or Restore Selection Outline" "Scale Notehead Sizes" "Scale Numbers" "Scales and Arpeggios" "Scordatura" "Score Original Version" "Screen Reader" "Select All Following" "Select Notes in Chord Position" "Select Passage" "Select Passage All" "Select Range" "Select Staves" "Select Staves for Sibelius 6" "Select Tuplet Over Barlines" "Selection Inverter" "Set Instrument Sounds" "Set Metronome Mark" "Set Play on Pass" "Set Space Before First Note In Bar" "Set Tie Style" "Set Tie Style Dashed" "Set Tie Style Dotted" "Set Tie Style Solid" "Shift Horizontal" "Shift Line Height" "Shift Lyric" "Shipping Plugin Names" "Shorten Tuplet" "Show Barnum Minimal" "Show Handbells Required" "Show Hide Instrument Names" "Show Staves In Parts Only" "Shuffle Pitches" "Simplify Accidentals" "Simplify Part Names" "Simplify Tied-To Notes" "Simplify Tied-To Notes Timer" "Slash Notes At Mid Line" "Slides From Nowhere" "Slides From Nowhere_Slide" "Smarten Quotes" "Solfège" "Solfège With Octave" "Solo Or Mute By Voice" "Split Bar" "Split Bar Hidden Staff Fix" "Split Bar Rests" "Split Bar Test" "Split Dotted Quarter Rests" "Split Multirests" "Split Score Into Movements" "Split or Join Tuplets" "Split or Join Tuplets2" "Store Data For Wildcard" "StrMethodTurnsGlobalVar.plg" "Straighten Written-Out Swing" "String Harmonics" "String Harmonics Sounding Pitch" "Strummer" "Style Sheet" "Suggest Cue Locations" "Swap Or Replace Text Styles" "Swing Fix" "Switch Windows" "Symbol As Text" "Symbols Swap System and Staff" "System Object To Staff" "System Objects 2" "System Passage To Passage Selection" "Systems Per Page" "Test" "Test Call To Plugin With Bad Data" "Test Change Duration Note Rest" "Test Character QT" "Test Copy Clip 0 To 9" "Test Deselect Note" "Test Duplicate Plugin" "Test Edit All Fonts" "Test Is Valid Is Object" "Test IsValid On Null Folder" "Test List Box" "Test Move Dialog" "Test Note Colors" "Test Plugin To Copy" "Test Show Colors" "Test Sys Copy" "Test TOB API Calls" "Test Tuplet Routines" "Test Zero User Property" "Text Styles" "Text Styles Built In" "Text Styles Used" "There It Is!" "Tidy After Conversion" "Tidy Appended Score" "Tidy Score" "Tie Common Notes" "Tie Extended Stable" "Tie Symbols for Second Ending" "Ties Into Second Ending" "Ties Into Second Ending Draft 2 Styles" "Time Codes" "Time Signatures For Irregular Bars" "Timing For Selection" "Tin Whistle Fingering" "Toggle Note Tied Into" "Toggle True LV Ties" "Top Note Chord" "Trace Bar System Page" "Trace Colored Notehead Styles" "Trace Colored Objects" "Trace Duplicate Bar Numbers" "Trace Expression Text" "Trace Fonts For Text Styles" "Trace Fonts In Installed House Styles" "Trace Harp Tuning" "Trace Hidden Objects" "Trace Initial Text Font And Size" "Trace Internal Bar Numbers" "Trace Internal Page Numbers" "Trace Lines" "Trace MIDI Messages" "Trace Mag Layout No Default" "Trace Magnetic Glisses" "Trace Name Pages Staves" "Trace Note String Number" "Trace Pipe Ornaments" "Trace Quartertones" "Trace Score Name" "Trace Score Objects" "Trace Score Objects Old" "Trace Stem Direction" "Trace TAB Collisions" "Trace Text Formatting" "Trace Tuplet Different Unit" "Trace Unmodified Symbols" "Traditional Lyrics Beaming" "Transfer Hit Points" "Transfer Plugin Settings" "Transfer Score Info" "Transform Scale" "Translate Folder of Scores to MusicXML" "Translate Harp Pedal Diagrams" "Transpose By Interval" "Transpose copies" "Tuplet Over Barlines" "Tuplet Preferences" "Turkish Pitch Bends" "Unarpeggiate" "Unfilter Selection" "Unfilter Selection Whole Bars" "Unfold Repeat Bar Rests" "Unfold Repeats" "Unformatted Text With Line Feeds" "Unlink Objects in Parts" "Verse Styles For Lyrics" "What Is Where" "Where Did It Go?" "Which House Style To Use" "Word Wrap Text" "Write Out Staff Text All Styles" "X Y Offset" "rdhw1" } dlg_strPlugin "12-Tone Matrix" _msgNoPluginSelected "Please click on a plugin to run." ChangePluginList "() { g_fPluginSelected = True;}" g_fPluginSelected "true" _msgPluginNotFound "Plugin was not found. Perhaps it was deleted or renamed since it was added to the recent plugin list. No plugin was run. Name is: " dlg_fSaveScores "false" dlg_fFullySelectOpenScores "true" dlg_fTraceScoreNames "true" dlg_fTraceNumScores "true" _msgDuplicate3 " whenever that name is chosen, the file name of the plugin that will run is: " dlg_strFindInList DoFindInList "() { // setup for general routine //Sibelius.ResetStopWatch(1); strCur = '' & dlg_strPlugin; // current entry in list box ('' if none) strPattern = '' & dlg_strFindInList; // edit box entry lst = dlg_lstPlugins; idListbox = 'IDC_LISTAll'; // NOTE: in code below the lines with UPDATE ME need to use the global variables or literals appropriate to this plugin strResult = FindInList(strCur, lst, strPattern); //trace('FindInList Result: ' & strResult); if (strResult != '') { dlg_strPlugin = strResult; //***UPDATE ME Sibelius.RefreshDialog(); } //if (Sibelius.ProgramVersion >= zg_Sib713Version) //{ // if (fFocusToListbox) // { // Sibelius.SetFocusToControl(Self, dialog, idListbox); // } //} //time = Sibelius.GetElapsedMilliSeconds(1) / 1000.0; //trace('DoFindList time (seconds): ' & time); }" FindInList "(strCur, lst, strPattern) { if (strPattern = '') { return ''; } strPattern = utils.LowerCase(strPattern); // for case insensitive //trace('FIL strPattern: ' & strPattern); iCur = utils.GetArrayIndex (lst, strCur); if (iCur = -1) { iCur = 0; } for i = iCur + 1 to lst.NumChildren { strNext = '' & lst[i]; str = utils.LowerCase(strNext); pos = utils.Pos (strPattern, str); //trace('FIL str, pos: ' & str & ', ' & pos); if (pos != -1) { return strNext; } } // try from the start for i = 0 to iCur { strNext = '' & lst[i]; str = utils.LowerCase(strNext); pos = utils.Pos (strPattern, str); //trace('FIL str, pos: ' & str & ', ' & pos); if (pos != -1) { return strNext; } } return '';}" CloseQuietly "(score, fTrace) { // derived from bzutils.CloseScore 26 December 2020 bz fShowDialogs = False; // Closes all open scores and parts in current window at least with better error handling // Will correctly handle closing with fShowDialog = False, for Sib 7+ at least if (IsValidObject(score)) // souped up IsValid check. Will reject null. { // plugins crash after closing the last open score. Previously one could use Sibelius.New after closing the last score // but that now crashes too. Current workaround is to not close the final score, and display a warning if possible bz September 2020 if (Sibelius.ScoreCount <= 1) { MyMessageBox(_msgCannotCloseFinalScore); return False; } else { Sibelius.ShowDynamicPart(score.CurrentDynamicPart); // CloseWindow needs to have an activated score shown to work. if (fTrace) { trace('CloseQuietly closing. Sibelius.ProgramVersion = ' & Sibelius.ProgramVersion); } if (Sibelius.ProgramVersion > 20200600) { // this closes score and all open parts even if open in multiple windows. You can specify the score in the call! if (fTrace) { trace('CloseQuietly calling CloseAllWindowsForScore. Score FileName = ' & score.FileName); } Sibelius.CloseAllWindowsForScore(score, fShowDialogs); } else { if (Sibelius.ProgramVersion >= 7000) // CloseWindow not available prior to Sib 7 { Sibelius.CloseWindow(fShowDialogs); // will close all tabs of current active score in current window } else { Sibelius.Close(fShowDialogs); // will close all tabs of current active score in Sib 6 and earlier. } } return True; } } if (fTrace) { trace('CloseQuietly did not close. IsValidObject failed for passed in score'); } return False;}" _BackupScores "Backup Scores" g_strAuthor "by Bob Zawalich" IsValidOpenScore "(score) { // on return from plugin call, check that the score object is valid, and that the score is currently open if (IsObject(score) = False) { //trace('IsValidOpenScore IsObject(score) failure'); return False; } valRet = IndexOfOpenScore(score.FileName); //trace('IsValidOpenScore valRet = ' & valRet); if (valRet != -1) { return True; } return False;}" g_lstBackupScoreFolderNames { "Backup Scores" "Partiture di Backup" "Partitions sauvegardées" "Backup-Partituren" "Copias de seguridad" "Partituras de backup" } GetUnterminatedFolderName "(strFolderName) { // SaveAs says it wants a folder name with no ending path terminator strOrig = strFolderName; len = Length(strFolderName); chLast = Substring(strFolderName, (len - 1)); // last char in string if (Sibelius.PathSeparator = chLast) { strFolderName = Substring(strFolderName, 0, (len - 1)); } trace('GetUnterminatedFolderName strOrig, strFolderName: ' & strOrig & ', ' & strFolderName); return strFolderName;}" IsScoreUnsaved "(score) { // to work with any language do not want to use 'untitled' name. Rely on File object //trace(score.FileName); file = Sibelius.GetFile(score.FileName); ok = False; if (file = null) { ok = True; //trace('Unsaved file - GetFile returns null, name = ' & score.FileName); } else { //trace('file.Name: ' & '(' & file.Name & ')'); if (file.Name = '') { ok = True; } } return ok;}" DoSaveScore "(score) { if (IsScoreUnsaved(score) = False) { score.Save(); } else { MyMessageBox(_msgCannotSaveUnsavedScore); }}" _msgCannotSaveUnsavedScore "This plugin cannot save a score that was previously unsaved. Please save any such scores and run the plugin again." IsValidObject "(obj) { // IsValid will fail if you pass it a global variable, which I had done accidentally. There are also some seemingly normal // situations like cancelling out of OpenFileToSave that return null, but IsValid accepts it. // This set of tests has not failed in any tests I have done. bz December 2020. ok = ((obj != null) and (IsObject(obj)) and (IsValid(obj))); return ok;}" zg_Sib713Version "7130" _msgCannotCloseFinalScore "A plugin cannot close the only open score. You will need to close it manually." dlg_fCloseScoresIOpened "true" dlg_fProcessActivePart "true" dlg_fProcessFullScoreIOpen "false" dlg_fProcessFullScoreAlways "false" SetUpPreferencesData "(pPlugin, arsParametersPreferences, fTrace) { // **** You will probably not be able to set this up until at least all the variables in the dialog are set up. // each object to be saved or restored has 3 entries in the sparse array. // the first is the variable itself, which must be a global variable, such as those used in a dialog. // the second is a type name for the variable, which must be a literal string in lower case in English. (see below) // the 3rd is the variable key to be stored in Preferences. // ***Be sure the 3rd entry names are unique. This will be validated in AddPluginPreferencesLib // the allowable type names are 'boolean' (or 'b') (true/false), 'string' (or 's') (text or numbers) or 'array' or ('a'), a nonsparse array created with CreateArray(). // GetPreferences and SavePreferences will use this data to set and get the values of this variables. // for the variable keys, I typically use the internal name of the variable with any prefix removed. // so dlg_fRadio1 might use 'fRadio1'. // in this sample, I am using the variables used in the controls for the sample dialog in this template arsParametersPreferences.Push(dlg_fSaveScores); arsParametersPreferences.Push('boolean'); arsParametersPreferences.Push('fSaveScores'); arsParametersPreferences.Push(dlg_fCloseScoresIOpened); arsParametersPreferences.Push('boolean'); arsParametersPreferences.Push('fCloseScoresIOpened'); arsParametersPreferences.Push(dlg_fFullySelectOpenScores); arsParametersPreferences.Push('boolean'); arsParametersPreferences.Push('fFullySelectOpenScores'); arsParametersPreferences.Push(dlg_fTraceScoreNames); arsParametersPreferences.Push('boolean'); arsParametersPreferences.Push('fTraceScoreNames'); arsParametersPreferences.Push(dlg_fTraceNumScores); arsParametersPreferences.Push('boolean'); arsParametersPreferences.Push('fTraceNumScores'); arsParametersPreferences.Push(dlg_fProcessActivePart); arsParametersPreferences.Push('boolean'); arsParametersPreferences.Push('fProcessActivePart'); arsParametersPreferences.Push(dlg_fProcessFullScoreAlways); arsParametersPreferences.Push('boolean'); arsParametersPreferences.Push('fProcessFullScoreAlways'); arsParametersPreferences.Push(dlg_fProcessFullScoreIOpen); arsParametersPreferences.Push('boolean'); arsParametersPreferences.Push('fProcessFullScoreIOpen'); if (fTrace) { trace('SetUpPreferencesData filled array arsParametersPreferences'); pPlugin.API_TraceSparseArrayPrefData(arsParametersPreferences); } return arsParametersPreferences.Length; }" _strAddPluginPreferencesLib "AddPluginPreferencesLib" GetAddPluginPreferencesLib "(fWarnIfMissing, fFirstTimeInSession) { strPlugin = '' & _strAddPluginPreferencesLib; pList = Sibelius.Plugins; ret = pList.Contains(strPlugin); if (ret = False) { if (fWarnIfMissing and fFirstTimeInSession) // only warn once per session { msg = utils.Format(_msgPluginNotInstalled, strPlugin, strPlugin); trace(msg); MyMessageBox(msg); } return null; } // the plugin object you get from searching the pList does not work for calls, but it works for getting properties ptrPreferences = @strPlugin; // appropriate pointer for calling the plugin return ptrPreferences; }" _msgPluginNotInstalled "The plugin %s is not installed, and without it, this plugin will still run, but its plugin preferences will not be saved across Sibelius sessions. Install %s to save preferences." }