XRNS Script Frontend 1.08

Developed by Alexander Stoica 2007 - 2010

License: Public Domain
http://xrns-php.sourceforge.net

Use info@beatslaughter.de for feedback or bug reports.

http://www.beatslaughter.de


What is it?

XRNS Script Frontend can be used, to provide a graphical user interface for command line scripts written in PHP on the windows operating system.

How does it work?

The frontend includes a stripped down version of the PHP scripting language, which is known for easy XML programming and is widely used. It's also possible to use external command line tools without requiring the user to copy them somewhere into a known path. Each script has a small config file, which defines how the GUI should be build and also holds some other infos. A more in depth look at this file will follow shortly.

The folder "php" holds the PHP commandline interpreter and a windows batch file, which allows one to generate a phpinfo.txt, which might be of help when developing own scripts. Any additional scripts go into the "scripts" folder with their corresponding config file. If a script relies on any extra command line tools, one should put them into the "utils" folder.

Included in the "scripts" folder are version 1.0.7 of the XRNS-PHP scripts.

Optionally, you can download the scripts separately or get works in progress from SVN.
http://sourceforge.net/project/showfiles.php?group_id=203983
http://sourceforge.net/projects/xrns-php/develop

Script configuration file format reference

The script configuration files are just normal *.ini files widely used by other software too. You should name the configuration file using the same basename as your script. For example, if the script is named "yourscript.php", the configuration file should be named "yourscript.cfg".

The first line should always be the name of the section.

[config]

The following keys are used to provide general information about the script and are self explaining.

caption=Name of the script
author=Coded by John Doe.
url=http://www.johndoe.com
description=Short description, what your script does.

The "gui" key specifies, how the interface will be created. It accepts simple keywords, which are translated by the frontend. The order of the keywords is important, since all the information the user selects gets passed in that order as commandline parameters to the PHP script. Mutliple keywords need to be separated by a semicolon ";".

Following the tradition of the first example in other programming languages, here is a simple label showing "Hello world". The "label" keyword is used to place additional descriptions on the interface for the user. The text needs to be enclosed by round brackets "()".

gui=label(Hello world)

The "text" keyword can be used to request any type of text to be passed to the script. If you specify the keyword with optional round brackets "()", one can set a default text show in the textfield.

gui=text
gui=text(default text)

The "clipboard" keyword will pass the clipboard contents to the script through a temporary file. The script is responsible for writing back the modified data to this file. When the script has finished executing, the contents of that temporary file will be shown in the textbox on the interface.

gui=clipboard

The "folder" keyword allows the user to browse for a folder. The chosen path will then be passed to the script.

gui=folder

The "file" keyword allows the user to browse for a file to open. The chosen file will then be passed to the script. This keyword is usually used to select a source file.

gui=file

It's also possible to specify extensions, including a default one, which will be used when the user leaves the extension blank when entering or selecting a filename in the file chooser dialog. All extensions are enclosed in round brackets "()" and each extension will be separated by a comma ",". Prepend a "def:" to the extension, which one wants to define as default.

gui=file(def:xrns, xrni, zip)

The keyword "output" behaves nearly like the "file" keyword with some exceptions. The current directory will be set to the path of this file, similar like the user has called the PHP interpreter from this location. This keyword is usually used to select a destination file.

gui=output
gui=output(def:xrns, xrni, zip)

The last keywords are "options" and "dropindex". They are used to display a combobox, where one can choose one of multiple options. It's also possible to define a default selected entry. Since version 1.06:

gui=options(1, 2, def:3, 4, 5, 6, 7, 8, 9, 10); dropindex(low, def:med, hi, super)

As a summary, here is an example of how a complete configuration file looks like.

[config]
caption=Name of the script
author=Coded by John Doe.
url=http://www.johndoe.com
description=Short description, what your script does.
gui=label(Select an option:); options(1, 2, def:3, 4, 5, 6, 7, 8, 9, 10)

Thanks and Credits

This product includes PHP software, freely available from:
http://www.php.net/software.

Xiph.Org Foundation for the flac and ogg encoder/decoder utilities.
http://www.xiph.org

Info-ZIP Workgroup for the zip and unzip utilities.
http://www.info-zip.org

gnu.org for the CVS command line utility.
http://www.nongnu.org/cvs

Pelle Orinius for his excellent C programming IDE and compiler.
http://www.smorgasbordet.com/pellesc

Dac Chartrand for his original idea.
http://www.trotch.com

Marvin Tjon for some extra features added Version in 1.06
 

History

Version 1.08 (04/21/2010)
Version 1.07 (06/06/2009)
Version 1.06 (03/16/2008)
Version 1.05 (11/07/2007)
Version 1.04 (09/08/2007)
Version 1.03 (08/31/2007)
Version 1.02 (08/29/2007)
Version 1.01 (08/19/2007)
Version 1.0 (08/13/2007)