- + Scripting: Added a number of commands that allow you to change or ensure certain settings, and later (typically at the end of your script) restore them to the previous value.
Syntax: setting name, value=1|0|r
name: can be any of the following
ShowFloppies
ShowHiddenDrives
ShowHiddenItems
ShowSystemItems
ShowNethood
HideFoldersInList
ShowFolderSizeInList
SortFoldersApart
KeepFoldersOnTop
SortNatural
ResortAfterRename
AutoRefresh
value:
1 = true (default)
0 = false
r = restore previous value
Examples:
- If the nethood is currently hidden the following script
will show the nethood and then hide it again. If the nethood
was shown anyway the script will do nothing at all.
::setting shownethood, 1::setting shownethood, r
- The following will hide folders in list (or do nothing if
they are already hidden):
::setting HideFoldersInList - + Scripting got a new command:
- Filter
Action: apply a visual filter to the current tab
Syntax: filter [filterspec]
Examples:
::filter *.zip;*.rar = show only ZIP and RAR files
::filter = remove any filters
Wednesday, February 6, 2008
v6.80.0061 - 2008-02-06 11:56
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
5:55 AM
Tuesday, February 5, 2008
v6.80.0060 - 2008-02-05 14:11
- + Scripting: Added new stepping dialog. Looks better than before, and its screen position is remembered between steps, scripts, and sessions.
- + Scripting: Now in all arguments of all scripting commands the following types of variables are resolved in this order:
(1) User variables defined by "set", "unset", "input",
"inputfile", or "inputfolder"
(2) XYplorer variables like <curpath>, <dyyyy>, etc.
(3) Environment variables like %temp%, %appdata%, etc.
Obvious exception: The first argument (the variable name) of "set", "unset", "input", "inputfile", and "inputfolder" is not resolved.
Examples:
::goto <xypath> = goes to app path
::?goto <xypath> = pops stepping dialog first - + Scripting command "goto": Now, if the destination could not be reached you are prompted whether to continue the script or quit.
- ! Tree, List: Renaming volume labels (drive display names) by pressing F2 did not work with mapped drives. Fixed.
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
8:11 AM
Saturday, February 2, 2008
v6.80.0058 - 2008-02-02 10:21
- * Tree, List, Catalog: Made the borders around various boxes a little softer. Also the focused-and-selected item in a non-focused list is better discernible now from the other selected items.
- ! Highlight and Box Colors were not preset anymore in color dialog (since 2 days ago). Fixed.
- ! Reconnecting Mapped Network Drives did not work under Vista. Fixed.
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
4:20 AM
Friday, February 1, 2008
v6.80.0055 - 2008-02-01 09:51
- + Scripting got a new command:
- Focus
Action: focus one of the main controls
Syntax: focus {L|A|T|C}
Examples:
::focus = focus List
::focus L = focus List
::focus T = focus Tree
::focus A = focus Address Bar
::focus C = focus Catalog - * Scripting command enhanced:
- CopyText
Now variables in the text are resolved.
Example:
::copytext <xypath>
= copies XY's app path to clipboard - ! Script files: You could not wrap a script caption over several lines. Now you can.
Example:
This
copies
XY'
s path
::copytext <xypath> - * Scripting command "loadscriptfile" evolved to a very important command. So I renamed it to "load". But I keep "loadscriptfile" for back-compatibility.
- + Added some general variables that can be used in various places in UDCs and scripts. Note that all paths, even drives are returned unslashed (<curpath>, which is not a new variable, did slash drives before).
<curpath> The real current path
e.g. C:\Dokumente und Einstellungen\Donald\Desktop
C:\Dokumente und Einstellungen\Donald\Desktop\New Stuff
C: (was C:\ before!)
<curpath_s> The special current path (if applicable,
else = <curpath>)
e.g. Desktop
Desktop\New Stuff
C:
<xypath> XYplorer's path
e.g. C:\Programs\XYplorer - ! Restoring a currently unconnected mapped network drive on the fly did not work under Vista. Fixed.
- * Changed default keyboard shortcuts:
Window / Show Navigation Panel F8
Window / Show Catalog Ctrl+F8
Reason: Later I will add Show Tree (Shift+F8) and all makes sense. - * Rename special dialogs: Now the usage tips are displayed in a textbox from which you can select and copy stuff.
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
3:51 AM
Thursday, January 31, 2008
v6.80.0053 - 2008-01-31 18:16
- * Scripting command enhanced:
- LoadScriptFile
News: Now, you can reference the scripts to execute
directly from file by an ID (your free choice),
not just by its position.
Syntax: loadscriptfile scriptfile, [script to run]
- script to run: optional, will directly run the
script identified by this argument.
If the argument start with #, the script is
identified by its position.
Else the script is identified by an ID which is
defined in the script file.
See next paragraph for how to define this ID.
Examples:
::loadscriptfile testscripts.txt, #1
= run the 1st script found in testscripts.txt
::loadscriptfile testscripts.txt, demo
= run the (first) "demo" script in testscripts.txt - * Script Files syntax. Now, the script caption can contain a 2nd optional field for an ID (anything goes) that you can assign to the script. The separator is " : " (comma would be unpractical because it might be used in captions).
If no ID is defined the ID defaults to the caption itself.
If no caption is defined then there is no ID for this script.
New general syntax:
[Caption [ : ID]]::command::command::command [...]
[Caption [ : ID]]::command::command::command [...]
[etc]
For example:
- Paste this script to a file scripts.xys in app path:
Copy the newest file from Desktop : copynew
::step
::set $path, <curpath>
::goto Desktop|
::sortby m, d
::selpos 1
// foc list
::#1016
// copy
::#201
::goto $path
- Each of these scripts will execute it:
::loadscriptfile scripts, #1
::loadscriptfile scripts, copynew - ! Fixed some glitches conc. scripting.
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
12:16 PM
v6.80.0052 - 2008-01-31 10:26
- * Scripting commands enhanced:
- SelPos
New Syntax: selpos ["+"|"-"]position|"a"|"i"|"f", [count=1]
count: number of items to select, starting with position
if missing defaults to 1
if position is a, i, or f, count is ignored
New Examples:
::selpos 1, 3
= select 3 items starting with pos 1
::selpos +3, 3
= select next 3 items
- Set
Now allows having the argument separator (by default a comma
+ blank) in the value. This gives you an easier way to
supply arguments containing the argument separator without
having to reset it using the "sep" command.
New Examples:
::set ;, ,::copytext a; a
= sets ";" to "," and copies "a, a" to the clipboard
::set well, well, well, well::copytext well
= sets "well" to "well, well, well" and copies
"well, well, well" to the clipboard
- LoadScriptFile
Action: Load a file with scripts and pop up a menu made from
those scripts, or execute one of the scripts in the file
directly.
Syntax: loadscriptfile scriptfile, [# script to run]
- scriptfile: required, can be relative to app path.
If the given file is not found then XY will look for
"file.xys", so if you call your script files *.xys
you can skip adding the extension in the loadscriptfile
statement.
- # script to run: optional, will directly run the script
of that number (first script = 1) without popping a menu.
If no script of that number exists, the menu is popped.
Note that separators and other non-script items do NOT
count, so script #2 is the 2nd script, not necessarily
the 2nd menu item.
Examples:
::loadscriptfile RegExp-Both
= loads RegExp-Both.xys if it exists and RegExp-Both doesn't.
::loadscriptfile testscripts.txt
= popup a menu based on testscripts.txt
::loadscriptfile testscripts.txt, 2
= run the 2nd script found in testscripts.txt - * SC (Scripting Command) "set": now, any general XY variables found in the value are resolved.
Resolved variables:
<curpath>
<curfolder>
<d...> (current date)
<m....> (modified date of current list item)
<curext> (of current list item)
<curbase> (of current list item)
<curtitle> (of current list item)
<curver> (of current list item)
Examples:
::set $path, <curpath>::copytext $path
= copies the current path to the clipboard
::set $x, <dyyyy-mm-dd>::copytext $x
= copies the current date to the clipboard
::set $x, <ddddd>::copytext $x
= copies the current weekday to the clipboard - * Script files: now, there is NO blank inserted between appended lines. Solves a problem, and gives you more control.
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
4:28 AM
Wednesday, January 30, 2008
v6.80.0051 - 2008-01-30 12:01
- * Scripting command "UserInput": changed name to "Input".
- * Scripting command "Input": now, when you cancel the input dialog the current script is immediately ended.
- + Indenting in script files now also supports tab characters: Have any number of tabs at the beginning of a line, and it will be appended (after trimming the tabs) to the previous line.
- * Script files: Menu separators "-" now can be surrounded by any number of blanks (" - ") And are still recognized.
- + Scripting got new commands:
- InputFile
Action: Sets a user variable to a file name that can be selected via the common Windows Open dialog.
Syntax: inputfile [variable name], [path], [extension], [caption]
- variable name: required, anything goes, case matters
- path: required, can be relative to app path
- extension: optional, just the extension, no dot
- caption (for dialog): optional, anything goes
Examples:
::inputfile $file, C:\, bat, Select Batch File
= Presents dialog for opening *.bat files at C:\.
If user selects a file, its full path/file name is set to user variable $file.
::inputfile $file, C:\Windows
= Presents dialog for opening any file at C:\Windows.
::inputfile $file
= Presents dialog for opening any file at app path.
- InputFolder
Action: Sets a user variable to a folder name that can be selected via the common Windows Browse For Folder dialog.
Syntax: inputfolder [variable name], [path], [caption]
- variable name: required, anything goes, case matters
- path: required, default initial path
- caption (for dialog): optional, anything goes
Examples:
::inputfolder $folder, C:\, Select Folder::copytext $folder
- Set
Action: Sets a user variable to fixed value.
Syntax: set [variable name], [value]
- variable name: required, anything goes, case matters
- value: required, anything goes
Examples:
::set $year, 2008::copytext $year
= Copies "2008" to the clipboard.
- Unset
Action: Unsets a user variable that was previously set by Set, Input, InputFile, or InputFolder.
Syntax: unset [variable name]
- variable name: required, should exist
Examples:
::set $year, 2008::unset $year::copytext $year
= copies "$year" to the clipboard - * Scripting command enhanced:
- CopyText
New Syntax: copytext [text], [a]
text: required, anything goes
a: optional, if set text is appended
Example:
::copytext Blah, a
= append "Blah" to the clipboard
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
6:08 AM
Tuesday, January 29, 2008
v6.80.0050 - 2008-01-29 14:43
- +++ Scripting (r)evolution is in full swing: Here's User-Defined Variables!
Using the brand new scripting command "UserInput" you can freely define and set one or more variables that live until they are reset or the current script batch is done. The variables will be auto-replaced by their values in all arguments of all following scripts inside the current script batch.
Obvious exception: Within "UserInput" commands no user variables are resolved (else it would not be possible to reset a variable). Obvious advice: To avoid unwanted replacements your variable names should contain some special characters that are unlikely to find outside variables, e.g. $ or %. In other words, if you call your variable "e" you might run into some surprises... ;-)
Syntax: userinput [variable name], [caption], [default value]
variable name: required, anything goes, case matters
caption (for dialog): optional, anything goes
default value: optional, anything goes
Example:
::userinput $i, Enter increment start value, 01::rename , File-<#$i>
If you run this script batch, you'll get an input dialog where you can enter some value, say 007. The following command will then rename the currently selected file(s) to File-007.ext, File-008.ext, etc.
No time now for more examples, but believe me, this is an efficiency volcano! - + Scripting got two new commands:
- HighLight and Box
Action: Highlight/Boxcolor the current tree folder.
Syntax: highlight/box [|rrggbb]
Pass nothing to turn any current highlight off.
Examples:
::highlight FF0000 = set very red highlight
::highlight = remove any highlight
::box eeddcc = set pale brownish box
::box = remove any box color - * Scripting command "SelPos" has been enhanced: Now you can define positions relative to the currently focused item.
Syntax: selpos [[|+|-]position]|a|i|f
Examples:
::selpos 1 = select first item in list
::selpos 2 = select second item in list
::selpos +1 = select the next item
::selpos +5 = select the item 5 positions after current
::selpos -1 = select the item before current
Examples for some further enhancements:
::selpos = deselect all
::selpos a = select all
::selpos i = invert selections
::selpos f = select all files
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
8:43 AM
v6.80.0045 - 2008-01-29 10:08
- + Script files now support comments: Each line starting with // is treated as comment (= ignored by the script).
- + Script files now support continuation of a script over several lines: Simply have any number of blanks at the beginning of a line, and it will be appended (after trimming the blanks) to the previous line.
Example for a script file:
-----------------------------------------------------------------
// here's a dummy script file showing some possibilities
// =====================================================
// (1) comment lines start with //
// (2) a script may run over many lines: A line beginning with
// one or more blanks is appended to the previous line,
// with one blank auto-inserted between them
// (3) empty lines are always welcome:
//goto Desktop, sort by Modified
Desktop, Modified
// remove any visual filter (indented comments work as well)
::goto Desktop
::sortby m, d
// this is a menu separator:
-
// various test scripts
Copy Blah::copytext Blah
Copy Blah (2 lines)::copytext Blah <br> Blah
Copy Blah (2 longer lines)
// set " # " as line breaker, just for fun
::br " # "
// change argument separator to allow commas in text!
::sep /
::copytext Blah # Blah
// larger indents are no problem!
and this text goes on and on, and the lines do not have to end
with a blank to avoid that the words will clutch together on
appending: one blank is auto-inserted between appended lines!
// load the same file again; pointless but possible :)
// no menu caption = no problem
::loadscriptfile testscripts.txt
-
// add a caption without a script to have a clickable
// menu item without any function
Cancel
----------------------------------------------------------------- - * Rename Special Batch Rename. Before: "The original file extensions are preserved if the pattern contains no extension." Now: "The original file extensions remain unchanged." Always. Always? No, there's a switch now: If you really want to batch-change your extensions as well, append a "/e" to your pattern!
Examples:
Original name: test.txt
*-<myyyymmdd> test-20070607.txt
*-<myyyymmdd>.htm test-20070607.htm.txt
*-<myyyymmdd>/e test-20070607
*-<myyyymmdd>.htm/e test-20070607.htm
New<#01> New01.txt
New<#01>/e New01
New<#01>.csv New01.csv.txt
New<#01>.csv/e New01.csv
As you see, the /e switch simply means: drop the original extension. Then it depends on the pattern whether a new extension is supplied or not. But wait a minute! Now here's an interesting side effect of the new rules:
Original name: test.txt
ping.png/e ping.png
See? You can hard-replace the old name completely! And if a file ping.png already exists? Then the collision is auto-avoided like this:
Original name: test.txt; ping.png exists
ping.png/e ping-01.png
Not bad! BTW, the format of -01 depends on your settings in Configuration Report Number Suffix.
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
4:10 AM
Monday, January 28, 2008
v6.80.0044 - 2008-01-28 11:40
- +++ Evolution goes on: Added Plugin Scripts! Extremely powerful, portable, light-weight, and easy-as-can-be -- believe me, it took me only 10 minutes to code it! (Plus 1 hour debugging... ;-))
Here's the concept
~~~~~~~~~~~~~~~~~~
- In a nutshell: Popup a menu that's user-defined by a text file.
- You create a text file containing scripts (or script batches), one per line. At the beginning of each line (i.e. left of the first "::" script marker) you may define a caption. A "-" (no quotes) line will generate a separator in the menu. So, the general form of such a file could look like this:
[Caption]::command::command::command [...]
[Caption]::command::command::command [...]
[etc]
- There is a new scripting command LoadScriptFile (see next paragraph).
- Now when you run a "::loadscriptfile [scriptfile]" (the Catalog is a nice place for such loadscriptfile commands!), the script file is loaded and parsed, and a popup menu is created on the fly and popped at your mouse cursor, listing all the scripts (resp. their captions) found in the script file! What's left to do for you now is point and click.
- I guess you know what this means:
(1) You can have hundreds of hand-tailored commands just 2 clicks away, and they won't make the app one byte heavier or one millisecond slower.
(2) You can bundle commands needed for a particular project in one script file.
(3) You can easily share complex commands (e.g. RegExp Renames) with other users, and give them friendly names as captions.
(4) You can place a loadscriptfile command inside another script batch to present you a *choice* while a script is running; e.g.
"::goto Desktop::loadscriptfile scriptsortby.txt::selpos 1"
where scriptsortby.txt offers you a number of sort options right at your mouse cursor. - + Scripting got a new command:
- LoadScriptFile
Action: Loads a file with scripts and pops up a menu made from those scripts.
Syntax: loadscriptfile [scriptfile]
- scriptfile: can be relative to app path
Example:
::loadscriptfile testscripts.txt - + Scripting got a new command:
- CopyText
Action: Copies a piece of text to the clipboard; for multiline text you can use the line breaker <br>. It will be converted to a CRLF (= x0D0A) sequence.
Syntax: copytext [text]
Examples:
::copytext Blah
::copytext Blah <br> Blah
::br " # "::copytext Blah # Blah (see next paragraph) - + Scripting got a new command:
- BR
Action: Resets the line breaker <BR>.
Syntax: br [new line breaker]
- To include leading/trailing blanks the argument must be quoted.
Examples:
::br #
::br " # " - + Scripting got a new command:
- SelPos
Action: Selects one list item by position.
Syntax: selpos [position]
Examples:
::selpos 1 selects first item in list - ! UDC: Could crash when you added a new UDC, under certain conditions. Fixed.
- * Scripting: On scripting errors (invalid commands, missing script files) you are now prompted whether to continue the script or cancel.
Entry Type:
Beta Update
Posted by
XYplorer user : J_C_Hallgren
at
5:40 AM
