Required Macros

[threecol_two]

The download file on this page contains Macro Express modules and text files that are required in order to provide a uniform foundation upon which all other macros can be installed. Many macros call upon procedures to be launched in the background in order to perform an activity on an open file (e.g. a Score file). With ScorBox, there no longer is a restriction to one Score session at a time. With the modules on this page, it is now possible, in theory, to launch up to 99 separate ScorBox windows, operating any and all of Score’s various modules (Score, Page, Scorlas, Draw, etc.), and to navigate between those open sessions with ease while being able to perform any kind of automization process on any open file or in any active directory without having to explicitly specify which file or directory to process.

While the theory of up to 99 separate ScorBox windows seems compelling, the reality imposed by CPU processing power and RAM imposes a considerably lower limit. Whereas it is possible in Microsoft Word, for instance, to open a great number of documents at once and to navigate between them with ease, working with multiple documents occurs within a single instance of Microsoft Word. None of the modules of the Score suite has this potential. Within Score, the program is capable of loading and displaying only one page at a time. Therefore, working with multiple files simultaneously requires launching a separate instance of the Score program for each open file. The more files are open, the more DosBox sessions have to be running simultaneously, and this reality imposes an increasing load both on the CPU and on RAM, deteriorating performance. I have successfully run six different ScorBox sessions at once with no appreciable loss in performance, but anything in excess of that begins to impact the work environment in a negative way. The largest number of sessions I have run simultaneously has been ten, but some processes there ran very slowly. I don’t recommend it.

ScorBox really begins to shine when you run ancillary software in the background in order to perform some operation on an open file, or within an active directory. When working with Score in the “conventional” way, i.e. from a conventional command prompt (either genuine MS-DOS or CMD.EXE), operations you wish to perform on any of its output files (*.MUS files, *.EPS files, PMX files, or Score macro files) require you either to exit Score and then invoke the ancillary software in order to perform the change (after which you relaunch Score and reload the file), or to switch to a separate command line session or other Windows software and then manually to subject the desired file to processing.

With ScorBox, this multi-step approach is no longer required. Let’s assume you are working on TEST.MUS in Score; after the initial input, you usually run several preparatory EditScor scripts as well as Tom Brodhead’s LJ and Beam programs. If you are like most Score users, you’ll probably save your TEST.MUS file, exit Score, then at the command prompt first invoke EditScor, specifying the file you wish to process and the script(s) you wish to run, after which you’ll invoke LJ to process the same file, and finally Beam. You may be streamlining this process with a batch file. You might even instruct the batch file to relaunch the file automatically in Score, once processed. Still, this requires you to exit Score, specify the filename in some way, and then to relaunch Score in order to continue working with the file. If you had any RAM macros in Score, those would be lost (usually that’s not a big problem, of course). With ScorBox, none of this is necessary anymore. Instead, you can construct a Macro Express module to perform all those operations for you in the background, on the open file, simply by invoking a command (either through a keyboard shortcut, or by invoking it from a menu). Invoked in this way, any and all utilities that are capable of manipulating Score data files in some way can now be run as true “plug-ins,” as simple commands that are always accessible within Score itself.

Over the years, I have developed a great number of EditScor scripts; some of them I use all the time. For instance, I have developed an EditScor script that automatically breaks barlines around any text items, where required. Now, when I am working on a file and need to break a number of barlines, I simply go to an “EditScor” menu, select “Break barlines,” and all barlines are then broken automatically on the open file. If I change my mind, I can undo the operation at the click of a button. ScorBox, therefore, now makes it possible to develop and implement an unlimited number of commands that are capable of performing changes on any open Score file in ways Score has absolutely no provisions for.

In order for this to work, however, ScorBox needs basic information. If you want to fix all beams in an open file by invoking a “Beam” command, for instance, in order to subject the file to processing through Tom Brodhead’s Beam program, the Beam program, running unseen in the background, still needs information about which file it is supposed to process. The process becomes even more complicated if you have multiple ScorBox sessions running. If you have five Score sessions running, in five different directories located on as many separate drives, how will Beam know which of those files you are currently working on, and in which directory / drive that file is located? DosBox by itself provides none of this information, and has no utilities to track path information.

In order to allow this to work in any scenario, you’ll need to enable Macro Express to track automatically the number of open ScorBox sessions, the path to any underlying directory, and the identity of any open file. The text files and Macro Express modules in the download file on this page are designed to solve this problem. For this reason, I classify them as “required macros.” ScorBox – as a unified concept – will not function without the macros and text files available on this page.

The following goals have been addressed.

  1. Launch any number of Score sessions in ScorBox in a way that automatically creates “tracking information.” This means that information about current working directories is created automatically upon launch, and is dynamically updated each time the user navigates to a different directory.
  2. Allow for easy file and directory navigation. From any open Score file, open any other Score file by navigating through a conventional file manager in a graphic user interface. When opening a new file in this way, the tracking information is updated automatically. It has to be clarified here, in fact, that navigating to any new directory, or opening any file in another directory from within ScorBox must be accomplished with the navigation tools supplied here, and not with Score’s internal mechanisms for doing so. For instance, while Score allows navigation to another directory either by using the “CD” command, or by pressing the F7 key, doing so would not update the “tracking” information. DosBox knows nothing about Score’s command structure, so by itself, it is unable to “track” anything. However, using the Macro Express modules for opening files in other directories, or for simply navigating to another directory, will update the required tracking information. Note that the “g” command for opening files within an active directory continues to work as usual, of course, and has no impact on the “tracking information”: since the path location of any given file does not change when invoking the “g” command, tracking information does not have to be updated.
  3. Allow for easy switching between multiple open ScorBox sessions. This requires that each session is easily identifiable. It is not sufficient to click on different windows in order to activate them (that’s always possible, of course); but additionally, the user needs to be able to specify to which window he wishes to switch by selecting it from a list that is dynamically updated from the tracking information created and modified in steps 1 and 2.

These goals required the design of a unified approach that enables these implementations for all modules of the Score music publishing system. I have endeavored to make these tools flexible and robust enough that they should work on anybody’s Windows system; I eagerly await feedback and improvements of these modules. There should be very little a user has to do in order to create the ScorBox working environment. There should not be any need to use, revise, modify, or create any complicated startup batch files such as the one created by myself and revised / extended / improved by Tom Brodhead for launching Score modules through DosBox: all of the DosBox startup requirements to allow for smooth operation of all Score modules are addressed directly by the Macro Express modules here available for download. The user has to custom tailor only two things:

  1. Create two User Variables that will be available any time the system starts up (and therefore to Macro Express). You’ll have to do this only once.
  2. Modify certain “ScorBox” support files that provide very basic information. In essence, these are initialization files, simple text files, that provide information such as: which drives to mount in DosBox; the location of the Score executable; the path information for Draw libraries; PSC font file locations; etc.

(1) and (2) work in tandem. First, create two User Variables. Go to Control Panel / System and Security / System. Then click on Advanced system settings, and then click on the Advanced tab. Next, click on “Environment Variables…” and note the upper pane of “User variables” and the lower pane of “System variables”. You should already be familiar with navigating to this window from having defined path information when working with Score. Under the upper pane for “User variables,” click on “New…”, and then for “Variable name,” enter “ScorBoxSupportFiles”. Enter the variable name exactly as shown here, without the quotation marks. Under “Variable value,” enter the full path name for a directory entirely of your choosing within which you will place all required ScorBox support files. Create a NEW directory for this purpose, place no other files into it except for ScorBox support files, and never change its name. All ScorBox support files will be placed into it. On my system, that path is “S:\Score4\AADBox.” Once you have indicated your path, click OK. Don’t forget to create the actual directory! (Unless you are using an already existing directory.)

All Macro Express modules provided here rely on the existence of this User variable in order to be able to cull required information contained in various support files that the user will have to place in the directory of his/her choice. Without this variable, none of the tools will work.

Next, create only one additional User variable. Again, click on “New…”, and name this variable “SwapVariable1” (without the quotation marks), and under Variable value, type anything (I typed “Any string. Use for moving things around;” see image above). As the name suggests, SwapVariable1 is used occasionally for swapping information around. For instance, it is now possible to copy an item from one open Score session and paste it into another open Score session (try doing that the “conventional” way!). Again, this is a required User variable.

NOTE: once you have created these two User variables, they won’t immediately be recognizable to Macro Express. Macro Express only recognizes those Environment Variables that existed when it launches. Therefore, if Macro Express was already running in the background while you created these two new Environment Variables, you will have to exit Macro Express and then restart it. That should suffice for it to be able to recognize your two new Environment Variables. In the unlikely event that there still is a problem, however, simply reboot your system.

Next, the user will have to provide different pieces of information in various ScorBox support text files that are provided with the modules. For instance, the macro called “Launch Scor4.exe” depends on several text files within the ScorBox support directory (the one specified in User variable “ScorBoxSupportFiles”):

  1. score3-location.txt
  2. score4-location.txt
  3. launchonly.top
  4. drive-mounts.txt
  5. default-drive.txt
  6. default-directory.txt
  7. default-extension.txt
  8. getShortPathName.bat
  9. favorite-directories.txt
  10. program-names.txt

To view the requirements for each of these support files, read the description on the “Launch Scor4.exe” page.

Once you have set up your two User variables and provided the necessary information in the support text files that accompany the various macros (see the descriptions on the pages for each macro), the only thing left to do would be for you to “import” the relevant macros into Macro Express; review their keyboard shortcuts (“hotkeys”) if any, and possibly assign them to a menu structure of your choice. No further setup should be necessary.

The same principle applies to all other macros (“modules”) available on ScorBox.com: download and unzip the posted file; where applicable, revise and save required ScorBox initialization text files in the ScorBox support directory, and import the macro into Macro Express.

I look forward to receiving feedback, bug reports, macro crashes, and suggestions. Please send your observations to:

administrator@scorbox.com

Good luck!

Posted by Jürgen Selk

revised:  5 July 2011.

  Added “GLOBAL Activate Score window for Accept Undo” macro to the download file; see the description on the relevant page. Future macro postings will call upon this macro, so it is advised to add the macro to the work environment.

revised:  28 March 2011.

  Added support for two additional support files: “path.txt” and “mode-settings.txt” (follow the prompts when first running any of the revised macros). The user should import the following revised macros into Macro Express: Launch Draw.exe; Launch Just.exe; Launch Page.exe; Launch Scor4.exe; Launch Score 3.1.exe; and Launch Scorlas.exe. All other macros have remained the same. The new support files will be created automatically when launching any of the revised macros for the first time.

revised:  24 March 2011.

  Two new features have been added to the ScorBox launch options for Score 3 or Score 4: launch Score “In one of my favorite directories” and “Launch multiple sessions from a startup file.” Those new features require the addition of the initialization file “favorite-directories.txt,” to be placed into the ScorBox support files directory.
Additionally, there had been no provision to account for Score version 4 modules (I had suspected this was going to be an issue, but hadn’t made provisions for it, as I don’t work with the commercial versions of Score 4). Thus, to illustrate, the ME macro “Launch Page.exe” would look for an executable called “PAGE.EXE,” causing the process to fail for individuals who work with a version of Page whose executable is called “PAGE4.EXE.” To resolve this problem, another initialization file has been added: “program-names.txt” (see the instructions inside that file, or read more details on the individual pages).
IMPORTANT. All modules for launching the respective Score components have been revised to account for this change (Launch Draw, Launch Just, Launch Page, etc.). I therefore recommend that youre-import all of those files into Macro Express to ensure full functionality. If you are hesitant to do so because you have already undertaken revisions on the modules you imported previously, rename your current modules to something else (e.g. rename your Macro Express module “Launch Draw.exe” to “Launch Draw.exe OLD”), then import all revised macros included in the download file on this page and check them for functionality.
An important new module has been added as well under “Required Macros”: “GLOBAL Find most recent file – TWO.” The initial upload of all required macros on 14 March 2011 included only “GLOBAL Find most recent file.” Further developments made it necessary to develop a similar module, called by some modules for other reasons, which therefore has been called “GLOBAL Find most recent file – TWO.” Please make sure that you download it and install it. The original file “GLOBAL Find most recent file” has remained exactly the same, but its nomenclature has changed from “GLOBAL Find most recent file” to  “GLOBAL Find most recent file – ONE.” Either rename the original macro accordingly (if you previously imported it), or simply obtain it from the download file on this page.

initial posting:  14 March 2011

[/threecol_two]

[threecol_one_last]

Download file:

RequiredMacros.zip

The zip file contains the following (click on any item in the list to read more detailed descriptions on each individual macro):

23 Macro Express modules:

19 support text files:

  • keystroke_speed.txt
  • default-directory.txt
  • default-extension.txt
  • getShortPathName.bat
  • LastWindowSelected.txt
  • LastScoreModuleLaunched.txt
  • draw-location.txt
  • just-location.txt
  • page-location.txt
  • score3-location.txt
  • score4-location.txt
  • scorlas-location.txt
  • launchonly.top
  • drive-mounts.txt
  • default-drive.txt
  • favorite-directories.txt
  • program-names.txt
  • default-library.txt
  • draw-libraries.txt

[/threecol_one_last]

 

Leave a Reply

Your email address will not be published.

Hardcore Music Publishing for the Seriously Committed