![]() To have double-quotes inside double-quotes they must be doubled. It's strongly recommended that you (double- or single-) quote your strings! While the script engine is currently still permissive with unquoted strings (msg Hi! works) this might not be so in the future, so you better do msg "Hi!" right away!Įverything is either in double-quotes, or in single-quotes, or outside of any quotes. Any number of blanks surrounding the concatenator are ignored. Strings and variables can be concatenated by dots. Or this (processing is from left to right, the last mapping wins): You can even do this (reversed or arbitrary order): The separator is ":=", the first position is 0 (zero). Instead of counting commas you now can prefix the position of the argument to the argument itself. Goto "Desktop|" sortby m, d sel 1 focus List This script goes to the Desktop folder (ensuring that the listing is unfiltered), sorts the list by date modified (descending), selects the first item, and moves the focus to the list: This little script will rename all currently selected items by appending the current date: The commands are separated by semi-colons ( ).Īrguments are identified either by position, or by a prefixed number denoting their position (see Numbered Arguments below). The arguments are separated by commas (, ).Ī script can have more than one command. ).Ī command can have more than one argument. There are commands consisting of a function name like msg or copytext, and arguments that can contain literals like "Hello!", and variables like %temp% (environment), (XYplorer), or $a (user-defined).Īn argument can have more than one part. ![]() First the variable $a is set to two strings, one literal and one variable, concatenated by a dot, then it is used in the msg command. You should see a message box displaying "Year 2009" (or whatever the year might be when you try this). First the variable $a is set to the current path, then it is used in the msg command. You should see a message box displaying the current path. When the message box is OKed, the second command copytext is immediately executed and the current time is copied to the clipboard. Try msg "Press OK to copy the time!" copytext "". is a native XYplorer variable that resolves to XYplorer's application path. ![]() %temp% is a standard Windows environment variable. You should see a message box that displays your TEMP path. Okay, now for something a little bit more interesting: (1) Well done, you just wrote your first XYplorer script! You should see a "Hello world!" message box now. (2) Paste msg "Hello world!" into the edit box. To get you started let's try something easy: More information, downloads, and a growing pool of examples is available here: However, you will eventually find out that it ain't rocket science at all. Without doubt, scripting is an advanced feature that only pays off if you take the time to dive into it and explore the ways and possibilities. Just drop a script file into your app folder and fresh plug-in commands are at your finger tips. You may share scripts with colleagues, or download them from the internet. Roll your own custom commands, combine them to scripts, wrap them in an XYplorer Script file (XYS), or a User-Defined Command, and trigger them by just a click or a keystroke. XYplorer Scripting, introduced with version 7.0, can truly be seen as the ultimate in file management efficiency. Variables Scope and Lifetime: Local, Global, and Permanent Variables
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |