SpaceMonger Customization
 

[ Prev: 5. Key Bindings | Up: Contents | Next: Contents ]    
      
   6. Actions     

SpaceMonger performs its work when it receives Actions, which are short strings like open and zoom-in that tell it what to do. Menus, push-buttons, key-presses, and even mouse clicks generate Actions. You can set Actions for menus, push-buttons, and key-presses, but the Action for each mouse button is hard-wired into the program.

There are five kinds of actions that SpaceMonger knows about. They are Built-In, Program Launcher, Opener, Help, and Composite.

 
   6a. Built-In Actions     

There are lots of actions that instruct SpaceMonger to perform various built-in tasks:

abort
Exit the program immediately, without waiting for any currently-active tasks (like file copying) to complete.
close
Synonym for exit and quit. Closes the program. Same as pressing the X-button in the corner.
exec [(path)] program args...
Run an external program. See full details below.
exit
Synonym for close and quit. Closes the program. Same as pressing the X-button in the corner.
help help-file-name
Opens a file in the help window. See full details below.
set-drive-bar drives|tree|recycle-bin
Changes the current contents of the left-side drive bar. Same as clicking on the drop-down menu above the drive bar.
set-root path
Changes the root-location to the selected path. Same as typing a path in the root-location box and pressing Enter.
 
   6b. Program Launcher Actions     

SpaceMonger has the ability to run other programs to perform various tasks. A launching action looks like one of these lines:

exec (C:\Windows) Notepad.exe exec (C:\Windows) Notepad.exe "Some File.txt" exec C:\Windows\Explorer.exe exec (C:\) "C:\Program Files\SpaceMonger.exe" C:\

In general, then, a launching action looks like this:

exec ( initial-path ) program-name [parameters]

exec program-name [parameters]

Launching actions are available in two forms; the first kind allows you to specify an initial path for the program to start in; the second kind simply assumes that the program should start in the root directory of whatever disk or folder you're currently browsing in the program.

Let's look at the examples. The first example switches into the C:\Windows directory and then runs Notepad.exe, searching for it first in the C:\Windows directory and then trying the various directories listed below.

The second example does the same as the first, but provides a parameter to the program: "Some File.txt". Notepad knows that its first parameter is a file to be opened. Other programs do different things with their parameters; consult their documentation to find out what.

The third example launches the Windows Explorer in the root path of the currently viewed disk or folder.

And the fourth example demonstrates that if you have a program to run that contains spaces in its name, you will need to surround the name with quotation marks to ensure that the system knows how to find it.

If a full pathname is not provided for a program, then it will be searched for in the following order:

  1. The given initial path, if any
  2. SpaceMonger's installation directory (usually "C:\Program Files\SpaceMonger")
  3. The Windows system directory (usually "C:\Windows\System" or "C:\WinNT\System32")
  4. The Windows 16-bit system directory (usually "C:\Windows\System" or "C:\WinNT\System")
  5. The Windows directory (usually "C:\Windows" or "C:\WinNT")
  6. The directories listed in the PATH environment variable, if any
 
   6c. Opener Actions     

In some cases, you don't want to run a program in an action; you simply want to open a specific file using whatever program may be attached, or you may want to open a specific folder in a new Explorer window. This is the purpose of opener actions.

Opener actions look like these examples:

open C:\Windows open nethood open "C:\My Documents\Report.doc"

In general, then, an opening action looks like this:

open file-or-folder-to-open

open special-folder-name

When you specify a file or folder, you should provide the full path to the file or folder. If you specify any relative pathnames, they will be measured relative to SpaceMonger's own installation folder (usually "C:\Program Files\SpaceMonger").

In addition to opening specific files or folders, you can also open certain special folders that have no specific path, such as the Control Panel, the Printers folder, and the Network Neighborhood. Below is the list of special folders:

  • admintools: (Windows 2000+) The folder storing administrative tools for an individual user.
  • altstartup: The folder corresponding to the user's nonlocalized Startup program group.
  • appdata: (Windows 98+) The folder serving as a common repository for application-specific data.
  • bitbucket: The virtual folder containing the objects in the user's Recycle Bin.
  • cdburn-area: (Windows XP+) The folder acting as a staging area for files waiting to be written to CD.
  • common-admintools: (Windows 2000+) The folder containing administrative tools for all users of the computer.
  • common-altstartup: (Windows NT+) The folder corresponding to the nonlocalized Startup program group for all users.
  • common-appdata: (Windows 2000+) The folder containing application data for all users.
  • common-desktopdirectory: (Windows NT+) The folder containing files and folders that appear on the desktop for all users.
  • common-documents: (Windows 98+) The folder containing documents that are common to all users.
  • common-favorites: (Windows NT+) The folder serving as a common repository for favorite items common to all users.
  • common-music: (Windows XP+) The folder serving as a repository for music files common to all users.
  • common-pictures: (Windows XP+) The folder serving as a repository for image files common to all users.
  • common-programs: (Windows NT+) The folder containing the directories for the common program groups that appear on the Start menu for all users.
  • common-startmenu: (Windows NT+) The folder containing the programs and folders that appear on the Start menu for all users.
  • common-startup: (Windows NT+) The folder containing the programs that appear in the Startup folder for all users.
  • common-templates: (Windows NT+) The folder containing the templates that are available to all users.
  • common-video: (Windows XP+) The folder serving as a repository for video files common to all users.
  • controls: The virtual folder containing icons for the Control Panel applications.
  • cookies: The folder serving as a common repository for Internet cookies.
  • desktop: The virtual folder representing the Windows desktop, the root of the namespace.
  • desktopdirectory: The folder used to physically store file objects on the desktop (not to be confused with the desktop folder itself).
  • drives: The virtual folder representing My Computer, containing everything on the local computer: storage devices, printers, and Control Panel. The folder may also contain mapped network drives.
  • favorites: The folder serving as a common repository for the user's favorite items.
  • fonts: A virtual folder containing fonts.
  • history: The folder serving as a common repository for Internet history items.
  • internet: A virtual folder representing the Internet.
  • internet-cache: (Windows 98+) The folder serving as a common repository for temporary Internet files.
  • local-appdata: (Windows 2000+) The folder serving as a data repository for local (nonroaming) applications.
  • mydocuments: (Windows XP+) The virtual folder representing the My Documents desktop item.
  • mymusic: The folder serving as a common repository for music files.
  • mypictures: (Windows 2000+) The folder serving as a common repository for image files.
  • myvideo: (Windows XP+) The folder serving as a common repository for video files.
  • nethood: A file system directory containing the link objects that may exist in the My Network Places virtual folder. It is not the same as network, which represents the network namespace root.
  • network: A virtual folder representing Network Neighborhood, the root of the network namespace hierarchy.
  • personal: (Windows XP+) The virtual folder representing the My Documents desktop item. This is equivalent to mydocuments.
    (Before Windows XP) The folder physically storing a user's common repository of documents.
  • printers: The virtual folder containing installed printers.
  • printhood: The folder containing the link objects that can exist in the Printers virtual folder.
  • profile: (Windows 2000+) The user's profile folder.
  • profiles: (Windows XP+) The folder containing user profile folders.
  • program-files: (Windows 2000+) The Program Files folder.
  • program-files-common: (Windows NT+) A folder for components that are shared across applications.
  • programs: The folder containing the user's program groups (which are themselves file system directories).
  • recent: The folder containing shortcuts to the user's most recently used documents.
  • sendto: The folder containing Send To menu items.
  • startmenu: The folder containing Start menu items.
  • startup: The folder corresponding to the user's Startup program group.
  • system: (Windows 2000+) The Windows System folder.
  • templates: The folder serving as a common repository for document templates.
  • windows: (Windows 2000+) The Windows directory or SYSROOT.

(Copyright note: This list is derived from the Microsoft web page that lists the CSIDL_* values for Windows up through and including Windows Server 2003. It was originally found at this address in a more extensive and detailed format: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp)

 
   6d. Properties Actions     

In some cases, you don't want to open a program or object; you simply want to display the standard Windows "Properties" dialog for it. You can do that using a properties action, which looks a lot like the corresponding opener action.

Properties actions look like these examples:

properties C:\Windows properties mycomputer properties "C:\My Documents\Report.doc"

In general, then, a properties action looks like this:

properties file-or-folder-to-open

properties special-folder-name

When you specify a file or folder, you should provide the full path to the file or folder. If you specify any relative pathnames, they will be measured relative to SpaceMonger's own installation folder (usually "C:\Program Files\SpaceMonger").

In addition to opening specific files or folders, you can also open certain special folders that have no specific path, such as the Control Panel, the Printers folder, and the Network Neighborhood (see the list above).

 
   6e. Help Actions     

It is not uncommon to want to open help documents within a program. SpaceMonger provides a built-in small, fast HTML renderer for displaying help documents. You may be using it to read this document right now. The HTML renderer is intentionally limited to make it small and fast; it can handle all of HTML 4.01 except scripts, style sheets, forms tags, and embedded-object tags.

Help actions look like these examples:

help doc/fr/index.html help doc/us/quickref.html#keystrokes

In general, then, a help action looks like this:

help help-file#section

help help-file

Help-file names are measured relative to SpaceMonger's installation directory. If a section is not specified, the help file will be opened to its default section or the top of its document, depending on what kind of file it is. Only one help window may be open at a time; if you use a help action and the help window is already open, it will switch to the new document.

Links in the help window are handled specially. First, SpaceMonger does recognize the <LINK> tag; you can use it to identify the previous section, next section, up section, and the table of contents. Second, <A> tags are handled specially: if the HREF attribute begins with sm:, then the succeeding text will be treated as an Action. Relative HREFs will automatically be opened in the same help window; if SpaceMonger sees an absolute HREF, it will open it in the user's default web browser.

Images are also handled specially. SpaceMonger's help window can only display BMP and Targa images (optionally LZSS-compressed). You cannot display GIF or JPEG images in the help window. However, you can use Targa's alpha channel for true transparency.

SpaceMonger also recognizes one non-standard tag: <NO-SPACEMONGER>. Anything between <NO-SPACEMONGER> and </NO-SPACEMONGER> will be ignored by SpaceMonger's HTML renderer, but will be displayed by other web browsers.

 
   6f. Composite Actions     

Sometimes a simple action just isn't enough by itself. For example, you might want to have a menu item that opens all three of your favorite spreadsheet program, word processor, and e-mail program at once. Or you might want to have a keystroke that opens drive C and then zooms in on the Windows\Temp directory. For these kinds of needs, there are composite actions.

A composite action is an action that is composed of one or more other actions. Think of it a little like a script or a macro, only simpler.

A composite action looks like this:

action1 ; action2 ; action3 ; action4 ...

Each of the individual actions may be any other action recognized by SpaceMonger, including other composite actions. As shown, SpaceMonger will perform action1, then action2, then action3, and so on until it runs out of actions to perform.

There are a few special (and very interesting cases), however. If you place an ampersand after an action, that will tell SpaceMonger that you don't want it to wait for the action to complete. Here is an example without the ampersands:

exec Notepad.exe ; exec Calc.exe

After opening Notepad in this example, SpaceMonger will sit stupidly waiting for Notepad to exit before opening the Calculator. Worse, SpaceMonger will assume that it should not do anything until both programs exit, and it will disable its own window until then. You can make both programs open simultaneously (and prevent SpaceMonger from waiting for them to exit) by adding ampersands:

exec Notepad.exe & ; exec Calc.exe &

In this example, SpaceMonger will open Notepad but won't wait for it to exit. As soon as Notepad has begun opening, SpaceMonger will immediately open the Calculator, and it won't wait for that either. It will immediately return to ready availability for whatever additional tasks you may have.

Note that the extra space characters in the above examples are not required; you can leave them out if you want.

Note also that some actions, particularly the built-in ones, will ignore the ampersand because it would make no sense --- for example, a zoom-in and a zoom-out acting simultaneously would make no sense at all. So SpaceMonger intelligently waits for the one to finish before starting the next.

    
[ Prev: 5. Key Bindings | Up: Contents | Next: Contents ]    

Copyright © 2002-2004 by Sixty-Five, Inc. All Rights Reserved.