Undocumented script commands - Suggestions
Undocumented script commands - Suggestions
Please suggest all script commands that are still undocumented (by Don).
Please add as much of your own documentation that you can (syntax, examples, etc.)!
I'll add them to the main (locked) thread afterwards (http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=13581).
Thanks for all contributions!
WARNING for visitors: undocumented commands are liable to vanish without a moment's notice. Exercise caution.
(This applies particularly to least-used, debug commands, those that have no conceivable use in regular scripting, but again, no undocumented command is perfectly safe.)
Please add as much of your own documentation that you can (syntax, examples, etc.)!
I'll add them to the main (locked) thread afterwards (http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=13581).
Thanks for all contributions!
WARNING for visitors: undocumented commands are liable to vanish without a moment's notice. Exercise caution.
(This applies particularly to least-used, debug commands, those that have no conceivable use in regular scripting, but again, no undocumented command is perfectly safe.)
One of my scripts helped you out? Please donate via Paypal
Re: Undocumented script commands - Suggestions
list each command in separate posts at the target topic. Better for linking.
Here's a nice template
----
cmd or func()
Description
SyntaxReturn
the return of the functions
Example
Remarks
Text
History
Here's a nice template
----
cmd or func()
Description
Syntax
Code: Select all
command [[params], [params=default]]
function([[params], [params=default]])
param1 description
more description
option1 description
more
option2 description
the return of the functions
Example
Code: Select all
Text
History
- <reverse chronological summary of versions where changes occurred>
- <try to link each one to that version's change log post (and include code-block quote of any mentions)>
- v??.??.???? - yyyy-mm-dd hh:nn - Introduction
Code: Select all
- <thread title>
- <links to forum discussions, etc.>
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Undocumented script commands - Suggestions
unthumb
removes all thumbnails from the current list (only the icons will be shown for the files) and closes the related cache files.
Syntax
Example
History
removes all thumbnails from the current list (only the icons will be shown for the files) and closes the related cache files.
Syntax
Code: Select all
unthumb [pane=a]
pane the pane to work on. Defaults to "a" for active pane.
possible values:
a active pane
i inactive pane
1 first pane
2 second pane
Code: Select all
unthumb i; //removes thumbnails from the inactive pane
- v14.50.0306 - 2014-11-16 20:11[/size]
Code: Select all
* SC unthumb: Added flag to refer to the pane to unthumb. Syntax: unthumb [pane=a] Examples: unthumb; unthumb a; unthumb i; unthumb 1; unthumb 2;
- v14.50.0305 - 2014-11-16 15:45 - Introduction[/size]
Code: Select all
+ Scripting: Added an undocumented command that removes all thumbs from the current list (only the icons will be shown for the files) and closes the related cache files: unthumb;
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Undocumented script commands - Suggestions
Documented officially now.
--
freshhere
Runs a new XYplorer instance with factory defaults, opened to current path.
Syntax
Example
Remarks
Since v14.80.0215, Fresh mode sets the App Data Path to subfolder "Fresh" of the normal App Data Path. This way it's impossible that any of your everyday settings are inadvertedly overwritten by the fresh instance.
History
--
freshhere
Runs a new XYplorer instance with factory defaults, opened to current path.
Syntax
Code: Select all
freshhere
Code: Select all
freshhere;
Since v14.80.0215, Fresh mode sets the App Data Path to subfolder "Fresh" of the normal App Data Path. This way it's impossible that any of your everyday settings are inadvertedly overwritten by the fresh instance.
History
- v13.10.0141 - 2013-10-28 17:40 - Introduction
Last edited by bdeshi on 26 Mar 2015 07:39, edited 2 times in total.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: Undocumented script commands - Suggestions
sendkeys
Simulate keyboard keypresses.
Syntax
Example
Remarks
Some often-used/special keycodes:
Depend on your keyboard settings, result may differ, i.e: "+." would translate to ">" on English keyboard layout but to ":" on German layout.
Simulate keyboard keypresses.
Syntax
Code: Select all
sendkeys [keys=""]
keys keycode(s) to simulate. Multiple keycodes can be joined together as a string and sent in sequence.
See "Remarks" section for details.
Code: Select all
setlayout("ShowAddressBar=1"); focus A; //focus addressbar...
sendkeys "^a"; sendkeys "{<}xydata+.~"; //... select all (CTRL+A), type <xydata>, and go there (ENTER)
Code: Select all
sendkeys "{5 5}"; //send 5 five times.
- To send special and exact keys, enclose key name within { }, for example: {Tab}, {%} {A}, {<}, {F1}, {{}
- To specify that any combination of modifier keys should be held down while several other keys are pressed, enclose the code for those keys in parentheses.
For example, to simulate SHIFT held down while E and C are pressed, use "+(ec)". - A single key can be sent multiple times: "{L 5}" sends L 5 times. Note that only one character at a time can be sent this way.
Some often-used/special keycodes:
Code: Select all
+ SHIFT, ^ CTRL, % ALT, ~ ENTER, {%} %, {Esc} ESCAPE, {Tab} TAB
Last edited by binocular222 on 12 Apr 2016 08:59, edited 4 times in total.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: Undocumented script commands - Suggestions
edittags
Opens a dialog for viewing and modifying the in-memory tags.dat data.
Syntax
Example
History
Opens a dialog for viewing and modifying the in-memory tags.dat data.
Syntax
Code: Select all
edittags
Code: Select all
edittags;
- v7.90.0079 - 2009-01-28 13:34 - Introduction
Code: Select all
+ File Tags: For developers and hardcore users there's a new undocumented and unsupported SC edittags. It works directly on the memory (not on tag.dat), and it works well... :)
Last edited by TheQwerty on 18 Mar 2015 15:48, edited 1 time in total.
Reason: Updated format and added references.
Reason: Updated format and added references.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: Undocumented script commands - Suggestions
msecs
Toggles the dispaly of milliseconds in displayed filetimes.
Syntax
Example
Remarks
The values set by this command are retained across sessions.
Using this without any arguments is the same as command #455 (Tools | Customize List | Date Column Format | Show Milliseconds).
History
Toggles the dispaly of milliseconds in displayed filetimes.
Syntax
Code: Select all
msecs [toggle], [decimals=3], [cropNulls]
toggle Show msecs in time columns?
0 = Hide
1 = Show
If empty or omitted, the state is toggled.
decimals Number of decimal places to show.
Defaults to 3.
If omitted, the last value is used.
cropNulls Crop trailing nulls?
0 = Leave nulls.
1 = Crop nulls.
Code: Select all
msecs 1, 7, 1; // Show msecs, with 7 decimal places, and crop trailing nulls.
msecs 1, 5, 0; // Show msecs, with 5 decimal places, and leave trailing nulls.
The values set by this command are retained across sessions.
Using this without any arguments is the same as command #455 (Tools | Customize List | Date Column Format | Show Milliseconds).
History
- v12.40.0304 - 2013-06-09 20:14[/size]
Code: Select all
v12.40.0304 - 2013-06-09 20:14 +++ Now the full NTFS filetime resolution can be displayed, edited, and reported. The resolution goes down to 1/10 of a microsecond (= 100 nanoseconds). Note that with today's hard and software the relation of such granular time expressions with temporal reality is less than perfect, but who knows what's coming. At least the present data structures are ready for such precision and data can be read and written already now. Now for the individual enhancements: > TIP: To display filetimes in the list with maximum resolution run either of these through the Address Bar: ::msecs 1, 7, 1; //show fractions ON; 7 decimal places; crop trailing nulls ON ::msecs 1, 7, 0; //show fractions ON; 7 decimal places; crop trailing nulls OFF Note concerning the display of fractions: - Less exact fractions are displayed truncated, not rounded. So for example this time: 2013-06-09 10:34:42.1888240 formatted as "fff" (milliseconds reolution) will display: 2013-06-09 10:34:42.188 and not rounded to: 2013-06-09 10:34:42.189 This is in accordance with the Windows API behavior in similar contexts, and ensures that XY's display will likely match the display of other softwares that can show sub second fractions of filetimes.
- v12.40.0301 - 2013-06-04 14:35[/size]
Code: Select all
! SC msecs (secret undocumented non-official scripting command from v6.80.0111 - 2008-03-15 11:35): Well, it did not show the correct milliseconds. Now it does. Also the state of showing milliseconds in the file list is now remembered between sessions.
- v6.80.0111 - 2008-03-15 11:35 - Introduction[/size]
Code: Select all
* Time-stamping, aka "Touch": From now on, the milliseconds (yes, NTFS supports milliseconds in file times) will be set to 0 (zero) when you touch a file date. Before they were ignored, resp. set to some uncontrolled random value. Tip 1: Use the undocumented scripting command "msecs" to toggle showing milliseconds in the file list! :)
Last edited by bdeshi on 26 Mar 2015 08:00, edited 3 times in total.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
Re: Undocumented script commands - Suggestions
caller()
Returns info about the script which called (via load, sub) the current script.
SyntaxReturn
Info.
Example
Remarks
This is analogous to the Self SC.
History
Returns info about the script which called (via load, sub) the current script.
Syntax
Code: Select all
caller(info)
info [required] any of the following:
file: calling script file (empty if none)
path: calling script file's path (app data if none)
base: calling script file's base (empty if none)
script: calling script
caption: caption of the calling script
icon: icon resource of the calling script
Info.
Example
Code: Select all
"Caller Info : callMeMaybe"
$script = caller('script');
$caption = caller('caption');
Text "caller caption: $caption<crlf>caller script:<crlf>" . $script ;
"Call Caller Info : callCallMeMaybe"
Sub 'callMeMaybe';
This is analogous to the Self SC.
History
- ~v11.90.0204 - 2013-01-10 20:20 - Approximate Introduction
Last edited by bdeshi on 24 Mar 2015 16:29, edited 5 times in total.
Win11 Pro 223H2 Gerrman
Re: Undocumented script commands - Suggestions
wait
pause script execution for the specified time.
SyntaxReturn
Example
History
pause script execution for the specified time.
Syntax
Code: Select all
wait [msecs=100]
msecs milliseconds to wait
Allowed values: 0 to 2147483647 (= 0x7fffffff = ~ 25 days)
Example
Code: Select all
echo "Hi"; wait 1000; echo "Nice day"; //echo two messages with 1 second (1000ms) pause inbetween.
wait; //minimum yield: let the OS do one thing
wait 2000; //let the OS do its things for 2 seconds (2000 ms)
wait 60000; //wait a minute
wait 1000; echo "Hi!"; //show message after 1 second
- v20.20.0004 - Promoted to official documentation.
Win11 Pro 223H2 Gerrman
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Undocumented script commands - Suggestions
Exist
Checks if a path exists and gives a quick report.
Syntax
Example
Checks if a path exists and gives a quick report.
Syntax
Code: Select all
exist [path=<curitem>]
path the path to check existence of. Can be a folder, file or server.
Code: Select all
exist "C:\Windows";
exist "\\server1\share2";
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Undocumented script commands - Suggestions
Snippet
This is a quick way of creating a button in your toolbar. Say you want a dedicated button to access C:\ drive, all you do is type ::snippet in AB and enter relevant details and you get the button. Type ::snippet in AB and copy-paste the below code:
This should create a new button which upon clicking will take you to C:\ drive
Change Name, Icon, ScriptL, Script and FireClick to your liking.
Name=Name of the button
Icon=path to icon file or internal icons such as :minitree or :drives or text label:C:\
ScriptL= Command to run when left clicking the icon
ScriptR= Command to run when right clicking the icon
FireClick= set to 1 to get a quick dropdown like effect, useful if you have multiple scripts and want menu like effect.
See the link below for one such script.
http://www.xyplorer.com/xyfc/viewtopic. ... 737#p51737
This is a quick way of creating a button in your toolbar. Say you want a dedicated button to access C:\ drive, all you do is type ::snippet in AB and enter relevant details and you get the button. Type ::snippet in AB and copy-paste the below code:
Code: Select all
Snip: CTB 1
XYplorer 12.20.0303
Action
NewUserButton
Name
C drive
Icon
label:C:\
ScriptL
goto "C:\";
ScriptR
FireClick
0
Change Name, Icon, ScriptL, Script and FireClick to your liking.
Name=Name of the button
Icon=path to icon file or internal icons such as :minitree or :drives or text label:C:\
ScriptL= Command to run when left clicking the icon
ScriptR= Command to run when right clicking the icon
FireClick= set to 1 to get a quick dropdown like effect, useful if you have multiple scripts and want menu like effect.
See the link below for one such script.
http://www.xyplorer.com/xyfc/viewtopic. ... 737#p51737
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Undocumented script commands - Suggestions
Note that the info returned by exist is only valuable for me. So it's merely useful for debugging.serendipity wrote:Exist
This command checks if a path and file exists and gives a quick report.
Syntax:
::exist “path/file”
Example:
::exist "C:\Windows";
FAQ | XY News RSS | XY Twitter
Re: Undocumented script commands - Suggestions
base64decode()
decode base64-encoded string or file.
SyntaxReturn
Returns decoded string.
Example
History
decode base64-encoded string or file.
Syntax
Code: Select all
base64decode(string, [flag=0])
string the string or file to decode.
flag Bit flag. A combination of these:
0 originally encoded string is not in unicode
1 originally encoded string is in unicode
2 string points to a file whose content should be decoded
Returns decoded string.
Example
Code: Select all
text base64decode("U2VjcmV0IQ=="); //returns "Secret!"
text base64decode("IQQ1BDoEQAQ1BEIEIQA=",1); //returns the unicode string "Секрет!"
text base64decode("<curitem>"); //tries to decode the *name* of <curitem>
- v14.20.0307 - 2014-07-02 21:48 - Allow to decode files directly. Added 2 to possible values of flag (src)
- v13.70.0139 - 2014-02-19 13:49 - Introduction (intro) (confirm)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Undocumented script commands - Suggestions
base64encode()
encodes a string or file content in Base-64.
SyntaxReturn
Returns encoded string.
Example
History
encodes a string or file content in Base-64.
Syntax
Code: Select all
base64encode(string, [flag=0])
string the string or file to encode.
flag Bit flag. A combination of these:
0 string is not in unicode
1 string is in unicode
2 string points to a file whose content should be encoded
Returns encoded string.
Example
Code: Select all
text base64encode("Secret!"); //returns "U2VjcmV0IQ=="
text base64encode("Секрет!", 1); //returns "IQQ1BDoEQAQ1BEIEIQA="
text base64encode("<curitem>"); //encodes the *name* of <curitem> into a base64 string
- v14.20.0307 - 2014-07-02 21:48 - Allow to encode files directly. Added 2 to possible values of flag (src)
- v13.70.0139 - 2014-02-19 13:49 - Introduction (intro) (confirm)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Undocumented script commands - Suggestions
logtofile
Create logs of certain app events to a file in <xydata>, or disable logging.
Syntax
Example
Remarks
This command is analogous to the commandline argument /log.
Note that both ways of setting the logging can be done simultaneously: their values will be combined (bitwise OR-ed). So when ::logtofile 1 has been set, and you start the app with /log=2, then both events, eLTFBackgroundJobAdded (1) and eLTFBackgroundJobTriggered (2) are logged.
The setting is remembered across sessions again if it was set by ::logtofile. Logging set by command switch /log=... is not remembered.
Log are saved as <xydata>\XYLog-<date yyyy-mm-dd>.txt. Eg, <xydata>\XYLog-2014-11-22.txt
History
Create logs of certain app events to a file in <xydata>, or disable logging.
Syntax
Code: Select all
logtofile [flag=""]
flag Control which events to log. Integer values can be combined.
0 deactivate logging
1 log background jobs added [eLTFBackgroundJobAdded]
2 log background jobs triggered [eLTFBackgroundJobTriggered]
"" or empty display current logging status in the statusbar
Code: Select all
logtofile 3; //log all added *and* triggered background jobs to a logfile
logtofile; //look at the statusbar
This command is analogous to the commandline argument /log.
Note that both ways of setting the logging can be done simultaneously: their values will be combined (bitwise OR-ed). So when ::logtofile 1 has been set, and you start the app with /log=2, then both events, eLTFBackgroundJobAdded (1) and eLTFBackgroundJobTriggered (2) are logged.
The setting is remembered across sessions again if it was set by ::logtofile. Logging set by command switch /log=... is not remembered.
Log are saved as <xydata>\XYLog-<date yyyy-mm-dd>.txt. Eg, <xydata>\XYLog-2014-11-22.txt
History
- v9.30.0004 - 2010-07-20 21:45[/size]
Code: Select all
+ Logging To File: New event and new IDs: eLTFBackgroundJobAdded = 1 eLTFBackgroundJobTriggered = 2 To log both: ::logtofile 3;
- v9.30.0003 - 2010-07-20 11:05 - Introduction[/size]
Code: Select all
+ Added Logging to File: Now you can optionally have certain events logged to a file named "XYLog-2010-07-20.txt" (date of today) and located in the app data path. Events are identified by a number (binary field). Currently only one event is supported: Background Job Triggered (#1). To activate logging for this event use the following new scripting command: ::logtofile 1; To deactive logging: ::logtofile 0; To show logging status: ::logtofile; //status is displayed in the statubar The setting is remembered across sessions.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]