Windows Shell Commands

Top  Previous  Next

When a sequence is started, Light-O-Rama can optionally also execute an arbitrary Windows command, running any program that you specify.

 

For example, some people broadcast the songs that play during their shows over radio, and would like the name of the song to be broadcast along with it, using the RDS ("Radio Data System") protocol, allowing people with RDS-enabled radios to see the name of the song that they are listening to.  RDS is not directly supported by Light-O-Rama, but you could set up your musical sequences so that, whenever one of them is played, Light-O-Rama will tell Windows to tell your RDS program to broadcast the name of the song for that sequence.

 

To set up a sequence to execute a Windows command, select "Windows Command" from the Sequence Editor's Edit menu.  After that, whenever that sequence is played (either by the Sequence Editor or the Show Player), the command will be executed.

 

Note, though: If the Show Player is running when you change the command associated with a sequence, you may have to stop and start the Show Player in order for this change to be picked up.

 

This feature is available only for the Advanced feature level.

 

Shell Command Variables
Sharing Sequences between Computers, and Security

 

Shell Command Variables

 

For the most part, a shell command will be executed exactly as you type it.  You can, however, additionally use certain variables, which will be replaced at run-time with various information, such as the title of the song associated with the sequence.  The following variables can be used (note: the exact result of using any of the date/time "DT_" variables may depend upon your computer system, so try them out if you need to rely upon an exact format):

 

Variable

Meaning

%%

A single percent character ("%")

%DT_a%

Day of week, abbreviated ("Mon")

%DT_A%

Day of week ("Monday")

%DT_b%

Month name, abbreviated ("Aug")

%DT_B%

Month name ("August")

%DT_c%

Date and time ("Mon Nov 29 16:32:37 2010")

%DT_d%

Day of month (01 through 31)

%DT_H%

Hour, 24 hour clock (00 through 23)

%DT_I%

Hour, 12 hour clock (01 through 12)

%DT_j%

Day of year (001 through 366)

%DT_m%

Month number (01 through 12)

%DT_M%

Minute (00 through 59)

%DT_p%

AM or PM

%DT_S%

Second (00 through 61)

%DT_U%

Week of year, with the first Sunday of the year starting week 01 (00 through 53)

%DT_w%

Day of week, number (0 through 6, Sunday being 0)

%DT_W%

Week of year, with the first Monday of the year starting week 01 (00 through 53)

%DT_x%

Date ("11/29/10")

%DT_X%

Time ("16:32:37")

%DT_y%

Year, two digit ("10")

%DT_Y%

Year, four digit ("2010")

%DT_Z%

Time zone ("EST")

%ENV_something%

The value of your computer's environment variable "something"; for example, use %ENV_PATH% to get the value of your computer's PATH environment variable

%MEDIA_ALBUM%

The name of the album that this sequence's media file is from (if set in your sequence)

%MEDIA_ARTIST%

The name of the artist that this sequence's media file is by (if set in your sequence)

%MEDIA_FILENAME%

The name of the sequence's media file, without path information

%MEDIA_FILENAME_FULL%

The name of the sequence's media file, with path information

%MEDIA_FILENAME_NO_EXT%

The name of the sequence's media file, without path information and without the file extension (such as ".mp3")

%MEDIA_TITLE%

The name of the song that this sequence's media file is (if set in your sequence)

%SEQUENCE_AUTHOR%

The author of this sequence (if set in your sequence)

%SEQUENCE_CREATED_AT%

The date and time at which the sequence was created

%SEQUENCE_FILENAME%

The name of the sequence file, without path information

%SEQUENCE_FILENAME_FULL%

The name of the sequence file, with path information

%SEQUENCE_FILENAME_NO_EXT%

The name of the sequence file, without path information and without the file extension (such as ".lms")

%SEQUENCE_MODIFIED_BY%

The name of the person who has modified the sequence (if set in your sequence)

 

Sharing Sequences between Computers, and Security

 

The ability to execute an arbitrary Windows command is very powerful, and even potentially harmful - for example, you could execute a command which will install spyware on your machine.  Therefore, it would not be wise to execute whatever Windows command another person chose, unless you are absolutely sure that the command they chose is safe and harmless.

 

For this reason, Light-O-Rama imposes a security measure: The command to be executed is not stored directly in the sequence file itself.  Instead, the sequence file contains a key for an entry in another file ("cmdmap.lcm", located in your Light-O-Rama sequences directory); that entry specifies the Windows command to be executed.  If that file doesn't contain an entry for that key, Light-O-Rama simply does not execute any command when the sequence plays.

 

So, you can use sequences created by other people without fear of spyware or other harmful programs, as long as you continue to use your own version of cmdmap.lcm, not a copy of the other person's cmdmap.lcm.

 

However, this means that if you yourself use Light-O-Rama on two separate machines - for example one to create your sequences on, and another to run your shows on - you will have to copy your "real" version of cmdmap.lcm from one machine to the other if you want your sequences to execute Windows shell commands.  You would typically do this at the same time that you copy your sequences themselves over from one machine to the other.