Commandline Addons

Top  Previous  Next

Multi Photo Quotes is now capable of using external commandline tools to generate quotes and images dynamically (for example by fetching them from the web).

 

QUOTE FILE USE OF COMMANDLINE TOOLS:

 

To use such a tool, you make a .txt quote file in a MpsMedia/Books, for example MpsMedia/Books/DynamicWikiQuotes/DyanmicWikiQuotes.txt

 

Normally a quote file is filled with quotes, one per line.

But in this case you will use a special meta command line in the quotes file, for example:

 

DcQuoteFile|Dynamically fetched quotes from the website quotesdaddy.com|quotesdaddy homepage|http://www.quotesdaddy.com

$$$appcap %quotedir%\quotesdaddyfetch.exe;;;%lastappcap%;;;$$$setimagedir %configdir%TestPics

 

The first line is the normal information line, the second is the special meta command.

 

The special meta command line is really a sequence of instructions, separatd by ;;;

 

The instructions can be of the following format:

$$$appcap COMMANDLINE WITH ARGS - runs an executable, waits for output, and captures output in %lastappcap%

$$$setimagedir FULL PATH TO IMAGE DIRECTORY TO USE - sets the image directory to use for this quote

$$$grabfile FULL PATH TO FILE TO GRAB OUTPUT FROM - grabs a quote from the specified file into %lastappcap%

$$$noquote - says that no quote cell/panel should be displayed

%lastappcap% - set the (current) quotestring to the output from the last application or file grab (do this before calling other string processing below)

$$$html2ascii - converts some html to ascii (should come after you do %lastappcap%)

$$$replace("FINDSTR","REPSTR") - replaces all occurences of FINDSTR with REPSTR (should come after you do %lastappcap%)

$$$apprunasync COMMANDLINE WITH ARGS - run the commandline asynchronously in a hidden window (ie dont wait for it); this is good for maintenance operations or asynchronously downloading pictures.  use $$$apprunasyncd do show the commandline window for debugging purposes.

$$$createdir FULL PATH - create the full path (will create multiple subdirs if needed)

$$$refreshdefaultimages - rediscover images in default image directories (useful if you download new ones)

 

Replacements made in the commandline string:

%appdir% - the directory where the screensaver application launched from (i.e. C:\Program Files\ even on Windows Vista)

%configdir% - the WRITABLE configuration file directory (i.e. C:\Documents and Settings\something..)

%imagedir% - the default directory where image files for this quote file will be read from (same as quotedir)

%quotefile% - the .txt quote file where the commandline was read from

%quotedir% - the directory where the quote file was read from

%monitorwidth% - the width in pixels of the monitor OR THE SMALL TILED WINDOW chosen for disaply (images will be scaled to this)

%monitorheight% - the height in pixels of the monitor OR THE SMALL TILED WINDOW chosen for disaply (images will be scaled to this)

 

NOTES:

 

You can have multiple such lines in a quotes file, one will be chosen at random.

If you don't specify %lastappcap% in the command somewhere, or any other string for the quote, a quote will not be shown.

 

 


 

IMAGE DIRECTORY USE OF COMMANDLINE TOOLS:

 

In addition to triggering commandline tools to generate quotes (and image files for quotes), you can also configure commandline tools to be triggered inside your image file directories, in order to generate a constant supply of images (either by downloading them or creating them dynamically).

 

To do this, create a file named "runimages.dat" inside one or more of your image directories.  These can be default image directories, custom image directories, or even quote file directories.

 

On each refresh of the screensavers, MPQ will look for such files inside the directories it plans on using on the screen (in other words runimages.dat files inside disabled books will not be invoked).

 

For each appropriate runimages.txt file found, MPQ will execute the commands in the file, using the syntax above (though note that monitor dimensions and quotefile variables are not set).  Note that a runimages.dat file will only be run once per screen update, even if there are multiple images from that directory being shown.

 

For an example of this in use, download the flickr commandline tool addon.