Download the latest
XYplorer BETA version (v6.80.0030, 21-jan-2008).
Choose one: (1)
Install Package, (2)
No-Install Package (each about 1 MB).
Code: Select all
v6.80.0030 - 2008-01-21 14:44
+++ Scripting: I took some time to decide about the scripting syntax
to have it maximally easy, efficient and robust at the same time.
Here's what I came up with.
General Rules
~~~~~~~~~~~~~
- A script begins with "::". Scripts can be concatenated to script
batches: ::script::script::script ...
- A script consists of a command name plus a couple of arguments
separated by a separator. The separator is by default a comma (,)
that MUST be followed by a blank. While the number of arguments
varies between commands (some have even none), the general form
of a script looks like this:
::command arg1, arg2, arg3
Example:
::goto C:\
- The order of arguments is fixed and given in each command
definition. Any arguments can be left out in which case the
default is taken.
::command arg1, , arg3 'arg2 is set to the default
::command arg1 'arg2 and arg3 are ~ ~ ~ ~
- If one of your arguments happens to contain the argument
separator + blank, parsing would fail. In this case you have to
redefine the separator by the following command:
::sep [new separator]
Example:
::sep ;::new a, b.txt; ; <curitem>
creates a copy of the current item and calls it "a, b.txt"
The redefined separator is valid until you redefine it again, or
until the current script batch ends. IOW, it is automatically
reset to comma if you call another script or script batch.
- All predefined keywords in scripting ignore case, so A=a.
- All arguments have leading and trailing blanks trimmed off.
Abundant blanks are okay. The following two lines are equivalent
::command arg1, arg2, arg3
::command arg1 , arg2 , arg3
New Commands
~~~~~~~~~~~~
Now, let's add some flesh to the bones! A couple of important
commands are now available through scripting: Goto, Open,
Openwith, and New! All four work identical to the corresponding
UDC categories, so you can think of them as the UDC GUI rolled out
into a line of characters.
To test the examples paste them into the address bar and Enter.
- Goto
Syntax: goto [target location]
Examples:
::goto C:\
::goto %temp%
Note that locations containing blanks do not have to be quoted.
- Open
Syntax: open [item to open]
Examples:
::open "winzip32" -min
::open firefox
::open C:\Programme\Mozilla Firefox\firefox.exe
- OpenWith
Syntax: openwith [application], s|m {= single|multi instance}
Examples:
::openwith UEdit32
::openwith UEdit32, s
::openwith UEdit32, m
Note that "s|m" means you have the option between s and m. The
first option in such kind of arguments is always the default. So
in this case, passing nothing is equivalent to passing s.
- New
Syntax: new [name], file|dir, [source]
Examples:
::new new file.txt
::new NewFolder, dir
::new <dyyyy-mm-dd>.txt
::new <curbase>_<curver>.<curext>, , XYplorer.exe
! Renaming files while they are previewed. Some heavy apps like Word
and Acrobat Reader did not get enough time by XY to release their
documents to let them be renamed. Fixed.