Open File

Activation: Hotkey Ctrl-o.

This macro enables you to open any legitimate Score file on your system through a standard file manager. You invoke this macro by typing the standard Windows command “Ctrl-o”. In the file manager, navigate in the usual manner; select a file, press Enter, or select a file and click on the “Open” button, or simply double click a file name:

NOTE that in order for ScorBox’s “tracking” mechanisms to function, if you wish to open a file in a directoryother than the one with which you launched the current ScorBox session, you have to open that file with this macro; otherwise, none of the “plug-ins” (background processes) will function, the “Window selector” for switching between open ScorBox sessions won’t work (see the “Window . . .” page), the “smart NX and NB” functions won’t work, and other functionality may be impaired as well. While you can employ this “Open file” macro to open any file in your current working directory as well, you can of course employ the usual “G” command within Score, or use “NX,” “NB,” and “RS” commands in the standard way.

In short, if you wish to open a file in a directory other than the current working directory, do not employ Score’s built in navigation commands, but run this “Open file” macro instead.

LIMITATION. When directories become too deeply nested, Score will fail to launch or to open files in such deeply nested directories. I have never been able to figure out how to quantify these restrictions: at which point is the path information too long? At the moment, I just don’t know – and honestly, I just don’t care. If you know or understand the details of this limitation, please e-mail that information to administrator@scorbox.com. I am sure that a way can be found for allowing ScorBox access to anydirectory, no matter how deeply nested or how long the path name is (I have some ideas…). But for the moment, I don’t care enough to undertake researching and constructing a solution (and I do not believe that moving files around temporarily is the best approach to doing that). If you come up with a solution, please submit your process to the e-mail address on the Submissions page.

In any event: if you attempt to open a file in a deeply nested directory, or in a directory whose path definition is too long, the file will fail to open. When that occurs, you have to backtrack. ScorBox creates tracking information – i.e. information about the current working directory of your active ScorBox session – within temporary text files in your ScorBox support directory. These text files are called “wrkdir?.txt,” where “?” is a digit signifying which ScorBox sessions the files are associated with. If you attempt to open a file in a directory that is too deeply nested, the file will fail to open, but the “tracking information” in the relevant “wrkdir?.txt” file will already have been updated. At this point, there will be a discrepancy between what the support file indicates to be your currently active directory and the directory actually recognized by Score.

The solution in that case is to move the file you had intended to open to a less-deeply nested directory (with a shorter composite path name), and then to employ the “Open file” macro again to attempt opening the same file in its new location. None of this is a major concern; simply be aware that due to Score’s internal limitations, this circumstance may arise.

Aside from the macro itself, two support files are required in order for “Open file” to function (see details under “Download file”). Place these files into your ScorBox support directory, as indicated in User variable”ScorBoxSupportFiles.”

“default-extension.txt” is dynamically updated when you open a file with the “Open file” macro; therefore, you do not need to modify this file when placing it into your ScorBox support directory.

“getShortPathName.bat” should be left as is. It is required in order to convert long path names into the 8.3 nomenclature Score’s internal navigation requires.

Within Macro Express, position this macro into General issues:

Finally, on my system, I have placed this macro into a “File…” menu branching off my master menu:

Inside my “File…” menu, I have placed the following items:

You may wish to organize your menus in the same way. A model menu is included for download (see details on “Model Menu“).

Posted by Jürgen Selk

initial posting    14 March 2011

Download file:

Macro Express module:

  • Open file (Ctrl-o) [SC]

Support files:

  • default-extension.txt
  • getShortPathName.bat

To avoid double-postings of macros on this site, this macro and the support file are included on the REQUIRED MACROS page.

The “support files” must be placed into your ScorBox support directory, as indicated in User variable “ScorBoxSupportFiles.”