Download url: http://members.nbci.com/tune_smithy/open_etc/open_etc.zip Author Robert Walker E-mail: open_etc@rcwalker.freeserve.co.uk ..........................Contents................................. Set up, How to use the program, Trouble shooting - Start In folder for SCALA Changing the default file names, Default for no arguments, Effect of the open command, C source code, Future develpments, Command line syntax ..........................Set up................................... Files are: open_etc.exe open_etc.ini paste.cmd p.cmd c.cmd copy.cmd open.cmd save.cmd open_etc_readme.txt (this file) open_etc_msvc_c_code.zip (for c programmers to read / edit) If you have made any files of these names already, you will need to rename the new files before putting them into the SCALA directory. (They are fine with the files that come with the SCALA 2.0 download). Unzip all the files into the SCALA directory. The various commands will also make these files and command files when used: ~copy.txt (copy) ~paste.scl (paste) o.cmd (open) s.cmd (save) Again this works fine with the default SCALA 2.0 command files. If necessary you can rename these - see later. ........................How to use the program..................... Each operation needs two steps to complete. To copy output to the clipboard from SCALA: @c SCALA commands to show the output you want @copy To paste a scale from the clipboard into SCALA as a SCALA file use @paste then @p To open a file into SCALA using windows explorer type open window, use: @open select the file in the usual way and click Open, or Cancel to revert to the file originally selected. Then to load it in SCALA: @o The Open button just completes your selection of the file to open. It doesn't actually open it yet. @o loads it in SCALA. To save a file from SCALA using windows explorer type Save As window @save select file and click Save (or cancel to revert to original selection). @s The Save button just completes your selection of the file to save. @s actually saves it. ..........Trouble shooting - Start In folder for SCALA............. These commands should work if @tutorial works. If not, here is how to fix it: When making a desktop shortcut, use right click on desktop, then New, then Shortcut, and browse for the scala app. Alternatively, RIGHT CLICK and drag the scala.exe file from Windows Explorer to the desktop, and choose Create Shortcut(s) here. If you left click and drag, you may drag a copy of scala.exe itself onto the desktop, and that won't work. Looks much the same as a regular shortcut on the desktop, but if you look closely, will see that it doesn't have the shorcut arrow on it. Both of these methods will fill in the working directory for the shortcut, which is what one needs for the command files to work. You can check it using Rt click on shortcut, then properties, and the Start In box should show the same path as the Target box up to the final \ ........................Changing the default file names............ Changing the default names for the command files and output files To do this, edit open_etc.ini, which is created first time the program is run. It will look something like this: MostRecentFile hexany.scl OpenCmd o.cmd SaveCmd s.cmd CopyFile ~copy.txt PasteFile ~paste.scl ShortcutFile scala.exe ShortcutDescr Scala ProgForNoArgs Scala.exe ArgForNoArgs Open.cmd Edit the entries, and replace any of the file names by whichever ones you want to use. If you change ~copy.txt, you need to update copy.cmd to use the new file name. Similarly, if you change ~paste.scl, you need to update paste.cmd and p.cmd. You can also rename open.cmd, paste.cmd, copy.cmd and save.cmd - this will only affect what you need to type to run the commands. Ex. to reduce amount of typing, rename @open.cmd to @op.cmd then to open a file in windows explorer and load it in SCALA: @op select file @o If you rename p.cmd, then you will want to edit paste.cmd to show the correct command to use to load the pasted scale. MostRecentFile hexany.scl This field will show whichever file you opened most recently, and is the one that will be used as default next time you choose open or save - this is how the file is remembered from one use of @open or @save to the next. ProgForNoArgs scala.exe = program to run if called with no arguments ArgForNoArgs open.cmd = arguments to pass to that program ShortcutFile scala.exe ShortcutDescr Scala These are for an extra feature: Open_etc can be used to create a desktop shortcut. Open_etc shortcut creates a desktop shortcut to the file scala.exe with description Scala You can change the filename and the description either in open_etc.ini by editing them, or by passing them on the command line to Open_etc as Open_etc scala.exe|Scala (with '|' separating file name and description) The path can be relative or absolute (including drive c:\ or whatever). Path and description can contain spaces; removes leading or trailing white spaces. ......................Default for no arguments..................... If you try to run open_etc on its own, this is fine, and what it will do is to start SCALA with open.cmd, means you open a file at the start of the session. You can customise this by specifying another command file in the ArgForNoArgs field. ....................Effect of the open command..................... Effect of the open command depends on the type of file selected: @xxx.cmd (run) load/map xxx.kbm (load as keyboard mapping) load xxx.scl example xxx.seq xxx.mid (make the midi file from the .seq) spawn/detached xxx.exe (spawn the .exe file) load/all xxx.lst load/unformatted xxx.txt @play xxx.mid (play it) Let me know if you'd like this extended in any way, or to have an option to customise what @o does for any of the commands yourself, or to customise the paste command, or ,... Would be easy to do if anyone wanted it... ....................C source code.................................. Program is free source. You can re-use the code as you wish in your own programs, and post your own updates of it freely. But, if you do have something nice you'd like me to add to it I'm open to suggestions. Note that it is written in c using a rather low level style of c programming - if you are used to C++ you may find this style somewhat unfamiliar. However, it is small enough so that hopefully it will be reasonably easy to find your way around it. ....................Future develpments............................. This program prob. won't be needed for SCALA any more once Gtk is updated to use Windows open / save and clipboard. However, I have in mind the idea that it might also be useful for other programs later that need to access Windows features. For instance, you could also spawn it from any console app as a way to use the Windows open dialog etc without needing to write a windows program proper. Your console app could then wait for the spawned process to exit, then open the file it has created. When used this way, doesn't have to be a two stage process anymore - reason for the two steps is that the first step launches Open_etc.exe and the second step then has the commands to execute when it exits. If one could wait for it to exit, one could do them all as single step commands. If you want to use it in this way, let me know, and I'll do the extra programming needed to let you customise the drop list of file types, and so forth. Or if a C programmer, you can easily do it yourself - the program is free source. ....................Command line syntax............................ Open_etc command line syntax: Final arg in <> is optional in each case Open_etc Open <...> defaults to last one shown, or *.scl first time it is run = Select the file and make o.cmd to use to open it. Open_etc Save <...> defaults to last one shown, or *.scl first time it is run = Select the file and make s.cmd to use to save it. Open_etc Copy <...> defaults to the CopyFile entry in the .ini file = Copy the file to the clipboard Open_etc Paste <...> defaults to the PasteFile given in the .ini file = Paste contents of clipboard to the file Open_etc shortcut <... | ...> defaults to the ShortcutFile and ShortcutDescr given in the .ini file = create a shortcut, program to start minimised. Defaults to minimised because if one starts SCALA minimised, then the GTk log window, which shows nothing in it in normal use, starts minimised, while the SCALA windows shows as usual, which is what one wants for a desktop shortcut. If you want to use it to make a shortcut for some program, and want it to start maximised, use Open_etc shortcutx, or if you want it to start normally, use Open_etc shortcutn ..................................... Best, Robert