INI Tweaks

Discuss and share scripts and script files...
Post Reply
jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

INI Tweaks

Post by jacky »

Hey guys,

So I've been a little less present, or shall I say active, lately due to other stuff, but I'm still watching :P

And when I saw the new getkey/setkey commands I just immediately thought of a little script file to deal with all the INI Tweaks we have, and as it happens with things like that, I just couldn't resist... :oops:

So here's a little thing I did, you just select/copy the following, paste into a nex text file (Ctrl+Alt+V) inside your <xydata>\Scripts folder and name it "INI Tweaks.xys" (for "internal reasons" it's actually important it's named that way, otherwise it won't work) and then when loaded you'll get a list of INI Tweaks, and for each one a little "info" and the ability to change it.

Of course, as goes the commands (which might be a little weird to tell you the truth...), you will have to "Restart without Saving" in order to have any changes be actually taken into consideration. If you don't, they will not be applied in your current session, and will not be remembered if you have "Save on Exit" enabled, or manually save the INI.

Wait, I'm not done with the blah-blah yet! :mrgreen: I thought I'd take this opportunity to "bump" a couple of things I mentioned in the past, since they haven't been implemented (yet) and I don't know if they are or not on Don's scripting 2.0 list (but they're on mine! ;))

- this little thing works using menus, poping up different menus over time, and it'd be pretty nice if they didn't had this tendancy to move to the (bottom-)right all the time, so if XY could always put them on the same place while on one "script batch"
I know I'd like that very much :)

- also, when doing long menu's like this one, the ability to show a menu with only a few items at times, and others at other times, would expand possibilities like crazy methinks. I've my own sets of scripts where that'd be really useful! :D
Here, we could have the full listing like now, but also one menu per "category", etc and all that without having to resort to using many many files, which is a pain when that means putting the same code in every file... go fix something then when you got to duplicate it in half a dozen files each time...

Okay, I'm done, here's that little script if you wanna play with it (there's a lot of text in there, it's the info-bits, pretty much copy/pasted from the XYwiki):

Code: Select all

"GENERAL "
"Never Start With A Running Search"
	copytext "Never Start With A Running Search/NoFindOnStartup/Settings/If you do not use a Permanent startup path, you may find yourself in a situation where XY will start on a Finding Tab, and as such a Find operation will be initiated as soon as the application is loaded. This can occur, for example, if you save your settings or exit XY with option Save settings on exit enabled, while the active tab is showing search results (i.e. it's a Finding Tab).<crlf>To ensure that there will never be a running search on startup, you can simply enable this tweak.";
	sub _doSwitchSetting;
"No Preview On Startup"
	copytext "No Preview On Startup/NoPropertiesStartup/Settings/When XY starts, and if you use the option Save settings on exit, the same state you were in when you closed XY will be restored. This could lead to unexpected behaviors like having the properties and/or preview of the currently selected&focused item to be initiated.<crlf>If you don't want this to happen on startup even when closing XY while previewing an audio or video file for example, enable this setting to ensure this won't happen.";
	sub _doSwitchSetting;
"Auto Focus List After Using Catalog"
	copytext "Auto Focus List After Using Catalog/SetFocusToListAfterCatalog/Settings/When you click on an item on your Catalog, the focus will stay on Catalog, unless you clicked an item that points to a file (without using option """"Open on click"""" or the file:/// protocol), then XY does put this file into view on List and give focus to the List.<crlf>If you want to have to focus sent to the List no matter what item you clicked on (eg. folders, """"Open on click"""" items, URLs, Visual Filters, etc) then you can do it by enabling this setting.<crlf>Note that this will only affect items, not categories, and will only apply when clicking on the item or pressing Enter while it's selected. Using middle-click, click while holding Ctrl or Shift, or using context-menu doesn't apply.";
	sub _doSwitchSetting;
"Allow Move On Rename"
	copytext "Allow Move On Rename/AllowMoveOnRename/Settings/There's a great """"hidden"""" feature in XY that can allow you to move an item at the same time as you're renaming it. When triggering Rename Mode on List (menu File|Rename (F2)), you will be able not only to specify a new name for the item (file or folder), but also enter a new path for the file ! The path can be relative to the current folder, or an absolute path (even on a different drive !)<crlf>You can use path that don't yet exists. In such a case, XY will create the path on-the-fly and move the item as expected. You can specify multi-folder path that don't exists at all, and XY will create the whole branch.<crlf>You can use absolute path, even specifying other drives or network locations, such as """"D:\Folder\file.ext"""" or """"\\server\share\file.ext""""<crlf>You can also use relative syntax, going either way : down, for example """"folder\file.ext"""" will move the file into subfolder """"folder""""; or up, for example """"..\folder\file.ext"""" will move the file in folder """"folder"""" at the same level that the current location.<crlf>This feature is not enabled by default.";
	sub _doSwitchSetting;
"Most-Recently-Used Lists: Use Match From Beginning Option"
	copytext "Most-Recently-Used Lists: Use Match From Beginning Option/AutoCompleteMatchFromBeginning/Settings/At first when you type text while on a control that support MRU (Most-Recently Used) list, the list of items matching what you typed so far was done using the """"match from beginning"""" option. From version 6.80.0027 onwards, XY now uses the """"match anywhere"""" option, so if item """"C:\Program Files\XYplorer"""" is on your MRU list, you can simply type """"XY"""" and it will match.<crlf>However if you would rather use the """"match from beginning"""" option (where you would have needed to enter """"C:\Program Files\XY"""" to match the same item, you can enable it with this setting.";
	sub _doSwitchSetting;
"New Folder Templates"
	copytext "New Folder Templates/Folder0/NewTemplates/On different occasions XYplorer will allow you to copy, move or paste items into a newly created folder ; namely through the extended drag&drop (Move/Copy Here to New Subfolder) or clipboard (Paste Here to New Subfolder...).<crlf>XY will have four different default names you can use if you want for this newly created folder. The first three come from templates in the INI, while the last one is the name (minus its extension) of the focused item at the time/while starting the drag (ie the one you start the drag&drop from).<crlf>Those are date/time sensitive so you must escape characters using backslash ( \ ).<crlf>Note that you are here only editing """"Folder0"""" which is also used when creating new folder (Ctrl+N), so edit the others please do it manually.";
	sub _doTextSetting;
"Show File Info Tips Only When Holding Shift"
	copytext "Show File Info Tips Only When Holding Shift/FileInfoTipHoldShift/FileInfoTips/When showing file info tips, XY must get some information about the hovered item in order to show them on the info tip. This process can take some time, thus slowing you down a little and you may experience a high CPU usage when moving the mouse over the List, especially with large files that needs to be accessed, such as videos for example.<crlf>To reduce this, you can use option Show tip only when hovering file icon to have file info tips to pop up only when you move the mouse over an item's icon (otherwise it's over icon or file name).<crlf>You can also/instead use another trick, which will make XY only show the file info tooltip when the Shift key is held down. That way, you'll only get the info tips when you specifically ask for them.";
	sub _doSwitchSetting;
"Change Unit Caption"
	copytext "Change Unit Caption/""UnitByte""/General/You can change the text used for unit when showing a size in bytes (statusbar, reports, etc).";
	sub _doTextSetting;
"Show Hidden Shares"
	copytext "Show Hidden Shares/ShowHiddenShares/Settings/By default hidden shares are, well, hidden, and as such not automatically shown on Tree, unless you go there (using Address Bar, Go to, etc). If you want such hidden shares to be shown automatically shown, enable this setting.";
	sub _doSwitchSetting;
"Only Display List Content When Done"
	copytext "Only Display List Content When Done/NoDisplayBeforeSort/Settings/When changing location, XY usually does display List content only after all items have been retrieved and sorted. But, when the file list is large and takes longer to fill, the some preliminary contents are shown as XY process continues. For instance, the List is first filled with items as they are retrieved, and then once again after all items have been retrieved and sorted.<crlf>Enabling this setting will have XY not draw/display anything until all items have been retrieved and sorted.<crlf>Note that this setting doesn't apply to Find mode / search results : items will always been added as they are found, and the List sorted once the search is complete.";
	sub _doSwitchSetting;
-
"INTERFACE"
"Change Row Height in List"
	copytext "Change Row Height in Tree/TreeItemDistY/Settings/As you may already know, you can reduce the horizontal space used on your Tree by using the option Narrow Tree. But if that's not enough for you, you can also change the vertical space used!<crlf>XY allows you to define the row height that will be used on Tree, List and Catalog independently.<crlf>The value you must entered is not the row's height per-se, as it may vary depending to the font used, but by how many pixels should the row's height be increased. You can enter values from -2 to 16, so you can actually reduce the row's height using negative values.<crlf>For more information about this, and another easier/quicker way to change this values, please refer to the XYwiki.";
	sub _doNumericSetting;
"Show Accessed Time"
	copytext "Show Accessed Time/NoAccessedTime/Settings/Each and every file/folder on your computer has 3 dates : Created date, Modified date, and Accessed date. That last one indicates the last time the item was """"accessed"""", even if no modifications were done. Unlike the other two dates, and on FAT32 drives, only the actual date (ie. no time) is stored, resulting in lots of """"00:00:00"""" everywhere on the Accessed column.<crlf>If you're tired of seeing those, XY lets you shorten the column by only showing the date (dd/mm/yyyy) without any time info. Note that this will also be in effect on the Properties tab on the Panel, and will NOT be restricted to FAT32 drives. So, if you have both FAT32 and NTFS drives (which do store a time value) it's up to you to decide: have 00:00:00 on FAT32, or don't show the (known) time on NTFS.<crlf>By default XY does show the time info, so to strip it down simply change enable setting.";
	sub _doSwitchSetting;
"Do Not Use Icons For User-Defined Commands Menu"
	copytext "Do Not Use Icons For User-Defined Commands Menu/UDCNoMenuIcons/Settings/XY has a very powerful feature, User-Defined Commands (or UDC), which allow you to create your own """"commands"""" with predefined parameters and options. One way to access those commands is through the menu User and by default XY will try, whenever possible, to use an icon corresponding the command (for example, a command to """"Open With"""" the notepad would have the icon of notepad.exe used)<crlf>If, for some reason, you did not want such icons to be used, you can enable this setting.";
	sub _doSwitchSetting;
"Change Tree Autoscroll Position"
	copytext "Change Tree Autoscroll Position/TreeRowForAutoScroll/Settings/As you know, the Tree always (if necessary) moves the current node (folder) into view when you browse by means other than the Tree (eg. using Catalog). Now there's a way to control where exactly the current node will be positioned within the view port (the part of the Tree currently visible).<crlf>If you set the value to 1 (2, 3, etc.) then the current folder, if not visible already without scrolling, will be auto-positioned at row 1 (2, 3, etc.) (if possible). If the value is 0, then the internal strategy is to scroll as little as possible to keep the current node visible, which is the way it was until v5.80.0002.";
	sub _doNumericSetting;
"Change Tree Position When Putting Focused Item Into View"
	copytext "Change Tree Position When Putting Focused Item Into View/TreeRowForDblClickScroll/Settings/A little tip you might already know: if you double-click on an empty area on Tree, it will automatically scroll (if needed) to put the selected node (ie. current folder) into view, unless you have option Dbl-click on empty space goes up. This can also be done using Shift+F6, and can be pretty useful after you scrolled up/down, during drag&drop or for copying/moving files for example.<crlf>When doing this, XY will put the selected node back on the first row (if possible). If for some reason you don't like that, and prefer to use another row, here's your chance!";
	sub _doNumericSetting;
"Use Your Own Titlebar"
	copytext "Use Your Own Titlebar/TitlebarTemplate/General/The titlebar of the main window of XYplorer, also used on taskbar, etc, reads as follow : [Current Location] - XYplorer @ [Filename.ini] - v[version number]<crlf>This title is actually highly customizable, as it follow a template you can adjust according to your needs/liking by tweaking your Configuration file. By default, this template used is : """"<path> - <app> @ <ini> - <ver>""""<crlf>As you can see, you can easily have the titlebar of XY set as you wish. The variables at your disposal are : <crlf><path> : current location<crlf><app> : the base of the filename of the currently running EXE file<crlf><ini> : the name of the Configuration file in use<crlf><ver> : version number<crlf>Please note that <app> is required, and must be surrounded by spaces. And as mentioned, its value is not a strict constant, but made out of the name of the running EXE, stripped of its extension. This allows you to have more than one instance running and easily identify them, renaming XYplorer.exe to something like XY-USB.exe or XY-Desktop.exe<crlf>This feature is only available to registered users. Trial version will use following template: """"<path> - <app> @ <ini> - <ver> ### 30-day Trial Version ###""""<crlf>Note that if you enabled the WOW64 File Redirection (available only on 64-bit Windows, menu View|Show Items|WOW64 Redirection (64-bit only) then """" - WOW64"""" will be appended to the window's title.";
	sub _doTextSetting;
"Popup Full Favorites Menu As Tree Context Menu"
	copytext "Popup Full Favorites Menu As Tree Context Menu/PopupFullFavMenu/Settings/When right-clicking on an empty area on Tree, XY will pop up your list of Favorite Folders, if you have any. Otherwise, it will pop up the full Favorites menu instead. If you want to have the full menu to be popped up even when you have Favorite Folders defined, enable this setting.";
	sub _doSwitchSetting;
"Popup Menus At Selection"
	copytext "Popup Menus At Selection/PopupMenusAtSelection/Settings/When popping menus up the menu usually pops up at mouse position. This is very convenient when using the mouse, but for keyboard-oriented people this might not be the most convenient way to go, especially for all menus popped up using a keyboard shortcut. If you enable this setting you will have all menus to pop up on the top-left corner of Tree or List depending of what menu is triggered.<crlf>In the mean time, context menu of items in Tree, List and Catalog will be positioned at the selected/focused item, if the menu is triggered by key.";
	sub _doSwitchSetting;
-
"PREVIEW"
"Add Custom Image Formats to Preview"
	copytext "Add Custom Image Formats to Preview/ImagePreviewCustomExtensions/Settings/You can add your own file types (extensions) of Image Previewed formats. Just like for Audio/Video formats you can define new extensions that XY should try to preview for Images. The value must be: <dot>extension[<dot>extension]<dot><crlf>For example, to add *.new and *.ext files use: """".new.ext."""" (without quotes)<crlf>Note that those will NOT be shown on the list of supported formats in the Configuration window.";
	sub _doTextSetting;
"Add Custom Audio/Video Formats to Preview"
	copytext "Add Custom Audio/Video Formats to Preview/MediaPreviewCustomExtensions/Settings/You can add your own file types (extensions) of Audio/Video Previewed formats. As you know XY can basically preview all formats that are supported by Windows (and the WMP). So you may have installed some codecs for files that XY doesn't include in its list of audio/video previewed formats, while it could actually play them!<crlf>The value must be: <dot>extension[<dot>extension]<dot><crlf>For example, to add *.new and *.ext files use: """".new.ext."""" (without quotes)<crlf>Note that those will NOT be shown on the list of supported formats in the Configuration window .";
	sub _doTextSetting;
"Add Custom Web/Office Formats to Preview"
	copytext "Add Custom Audio/Video Formats to Preview/OfficePreviewCustomExtensions/Settings/You can add your own file types (extensions) of Web/Office Previewed formats. Just like for Audio/Video formats (see above) you can define new extensions that XY should try to preview (using IE integration) for Web/Office. Note that the key might not already exists, if so just create it. The value must be: <dot>extension[<dot>extension]<dot><crlf>For example, to add *.new and *.ext files use: """".new.ext."""" (without quotes)<crlf>Note that those will NOT be shown on the list of supported formats in the Configuration window .";
	sub _doTextSetting;
-
"THUMBNAILS"
"Use Your Own Thumbnails Sizes"
	copytext "Use Your Own Thumbnails Sizes/ThumbSizes/Thumbs/When using Thumbnails as Views, XY offers you three different sizes of thumbnails you can use. You can define those from the Configuration, among a list of various pixel sizes for each dimension, for each size.<crlf>But what if you wanted to use another size which is not listed? In that case, you can simply specify which sizes are to be listed, using this setting.";
	sub _doTextSetting;
-
"SCRIPTING"
"Switch Recursion Checker Off"
	copytext "Switch Recursion Checker Off/ScriptRecursionWarningOff/Settings/When writing your scripts, you might want to have one script call itself (using command load or sub). Of course, if you don't take care, you could end up in an infinite loop which would result in some problems... Trying to prevent such an issue, XY comes with a recursion checker that will pop up a warning message when a recursion is spotted and gives you the opportunity to cancel the script execution.<crlf>If you do not want these warnings and are confident that you won't create an endless loop, you can switch off the recursion checker by enabling this setting.";
	sub _doSwitchSetting;
-
"MISC"
"Change Format Used When Pasting Image"
	copytext "Change Format Used When Pasting Image/ImageFromClipFormat/General/XY allows you to directly paste text or even images, creating new files on-the-fly. Using commands Paste Text Into New Textfile (Ctrl+Alt+V) or Paste Image Into New [EXT] File (Ctrl+Shift+Alt+V) found under menu Edit|Paste Special, a new file will be created with the text (or list of files) in your clipboard, or the current image respectively.<crlf>By default, images are pasted into new PNG file, but you can actually change the format to be used using this setting.<crlf>The possible values for this setting are png, jpg, gif, bmp and tif<crlf>When using JPG format, you can actually control the quality by appending it, from 1 (worst) to 100 (best), for example using jpg90 will use JPG format with a quality quantifier of 90. When no quality is specified (jpg) then a default value of 85 is used.<crlf>Note that the GIF quality is very bad (dithered) and practially unusable. The other formats, however, are of high quality. Also note that this feature requires GDI+.";
	sub _doTextSetting;
"Change The RegExp Rename Patterns Separator"
	copytext "Change The RegExp Rename Patterns Separator/""RegExpRenameSep""/General/When doing RegExp Rename operation, you have to define regexp patter and replace pattern separated by a """" > """" (without quotes). If you want to change this pattern, to remove the spaces or use a completely different separator, you can now do so simply by replacing the value of this setting.";
	sub _doTextSetting;
"Set File To Use For Tip Of The Day"
	copytext "Set File To Use For Tip Of The Day/FileTipOfTheDay/Settings/To learn new things about XY and discover some """"hidden"""" useful features you may not know about or remember, you can always hit Shift+F1 to open the Tip of the Day. Said tips are loaded from a file named TipOfTheDay.htm found in XY's data folder (<xydata>). You can change the name of the file from which to load the tips, which could turn out to be particularly useful if you want to use translated version of the tips for example.<crlf>Please note that the name for user tips will also be based on this setting, for example if you use MyTips.htm as filename to load the tips from, the user filename will be MyTips_user.htm";
	sub _doTextSetting;
"Add Opened Files To Recent Document List"
	copytext "Add Opened Files To Recent Document List/AddToRecentDocs/Settings/If you want, you can have XY to add to the Shell's list of recently opened documents any files opened from XY. Please note that this list isn't available or usable in any way from XY itself.<crlf>To have XY to add opened files to your recent document list, enable this setting.";
	sub _doSwitchSetting;
"Change The Application Data Folder"
	msg "Before version 6.80.0063, all the configuration, control and data files that XYplorer uses were stored in the application's path, i.e. the folder where the running XYplorer.exe is located. You can now specify the Application Data folder to be used by XYplorer as any location of your choice by creating a new file called startup.ini.<br>To use this feature, just create a new file called startup.ini in XYplorer's Application Path (where XYplorer.exe is located) and put something like this in it:<br><br>[AppData]<br>Path=D:\XYplorer Data<br>You may also use Environment Variables in the Path= value which has the following benefits:<br>- Move the Application Data folder elsewhere than in ""Program Files"", which may cause ""security problems"" under Vista (as XY requires read/write access in that folder)<br>- Allow each user of the same computer to have their own unique settings (including different Catalog, CKS, etc)<br><br>For example, using a startup.ini file with this : <br><br>[AppData]<br>Path=%appdata%\XYplorer<br><br>Will cause XY to use as its Application Data folder something like C:\Documents and Settings\UserName\Application Data\XYplorer -- thus getting a completely different profile for each user on the computer. <br><br>When using this option, the files which must remain in the Application Path are the following : XYplorer.exe, XYplorer.hlp, XYplorer.cnt and startup.ini.<br>The files which are stored in the Application Data folder are the following : catalog.dat, ks.dat, servers.dat, udc.dat, tipoftheday.htm, tipoftheday_user.htm, XYplorer.ini as well as any alternative INIs (if any), and the two folders FindTemplates and NewItems.<br><br>Naturally, if you change the Application Data folder you will have to copy your current files to the new location if you want to continue using your present configuration, Catalog, etc.";
	load *;
-
"Restart XYplorer without Saving, to apply any changes made"
	#190;
-
"Cancel"

"_doSwitchSetting"
	set $data, <clipboard>;
	regexreplace $title, $data, "^(.+?)/.*$", "$1";
	regexreplace $key, $data, "^.+?/(.+?)/.*$", "$1";
	regexreplace $section, $data, "^.+?/.+?/(.+?)/.*$", "$1";
	regexreplace $message, $data, "^.+?/.+?/.+?/(.+)$", "$1";
	
	getkey $current, $key, $section;
	regexreplace $state, $current, "^1$", "enabled";
	regexreplace $state, $state, "^((?!enabled).)*$", "disabled";
	regexreplace $new_state, $current, "^1$", "disable";
	regexreplace $new_state, $new_state, "^((?!disable).)*$", "enable";
	regexreplace $new_s, $current, "^1$", "2";
	regexreplace $new_s, $new_s, "^((?!2).)*$", "1";
	regexreplace $new_s, $new_s, "^((?!1).)*$", "0";

	copytext """ == $title == ""<br>-<br>""Info about this setting""<br>	msg ""$message<crlf>You have this setting currently $state."";<br>	load *;<br>""Switch: $new_state it""<br>	msg ""This setting is currently $state, are you sure you want to $new_state it ?"",1;<br>	setkey $new_s, $key, $section;<br>	msg ""You will NEED to restart XYplorer WITHOUT saving in order to have the change taken into consideration."";<br>	load ""INI Tweaks"";<br>-<br>""<< Back""<br>	load ""INI Tweaks"";";

	replace $script, <clipboard>, "<crlf>", "<br><br>";
	copytext;
	load $script,,s;

"_doTextSetting"
	set $data, <clipboard>;
	regexreplace $title, $data, "^(.+?)/.*$", "$1";
	regexreplace $key, $data, "^.+?/(.+?)/.*$", "$1";
	regexreplace $section, $data, "^.+?/.+?/(.+?)/.*$", "$1";
	regexreplace $message, $data, "^.+?/.+?/.+?/(.+)$", "$1";

	regexreplace $quotes, $key, "^"".+""$", """""";
	regexreplace $quotes, $quotes, "^((?!"""").)*$", "";
	replace $key, $key, """", "";

	getkey $current, $key, $section;

	copytext """ == $title == ""<br>-<br>""Info about this setting""<br>	msg ""$message<crlf>The current value for this setting is: """"$current"""""";<br>	load *;<br>""Set: change value [$current]""<br>	input $new_s, ""Please enter the new value :"",""$current"";<br>	setkey ""$quotes$new_s$quotes"", $key, $section;<br>	msg ""You will NEED to restart XYplorer WITHOUT saving in order to have the change taken into consideration."";<br>	load ""INI Tweaks"";<br>-<br>""<< Back""<br>	load ""INI Tweaks"";";

	replace $script, <clipboard>, "<crlf>", "<br><br>";
	copytext;
	load $script,,s;

"_doNumericSetting"
	set $data, <clipboard>;
	regexreplace $title, $data, "^(.+?)/.*$", "$1";
	regexreplace $key, $data, "^.+?/(.+?)/.*$", "$1";
	regexreplace $section, $data, "^.+?/.+?/(.+?)/.*$", "$1";
	regexreplace $message, $data, "^.+?/.+?/.+?/(.+)$", "$1";
	
	getkey $current, $key, $section;

	copytext """ == $title == ""<br>-<br>""Info about this setting""<br>	msg ""$message<crlf>The current value for this setting is: $current"";<br>	load *;<br>""Set: change value [$current]""<br>	input $new_s, ""Please enter the new value :"",$current;<br>	incr $new_s, $new_s;<br>	incr $new_s, $new_s, -1;<br>	setkey $new_s, $key, $section;<br>	msg ""You will NEED to restart XYplorer WITHOUT saving in order to have the change taken into consideration."";<br>	load ""INI Tweaks"";<br>-<br>""<< Back""<br>	load ""INI Tweaks"";";

	replace $script, <clipboard>, "<crlf>", "<br><br>";
	copytext;
	load $script,,s;
Yeah one more thing : was a bit too much of a PITA (plus I'm lazy) so it will empty your clipboard.
(Also, there isn't any check that the value you set are matching the expected syntax, just like with notepad ;))

And again, if you intend to use it to change any setting : you might want to save your settings before, not to loose any changes, and remember to restart without saving after.
Proud XYplorer Fanatic

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

Holy cow, thats brilliant. Just tried out and works like charm.
Thanks Jacky, great job.

Update: Infact it should be in XY by default.

graham
Posts: 457
Joined: 24 Aug 2007 22:08
Location: Isle of Man

Post by graham »

Jacky - that really is impressive and it just goes to show how people with your skills and knowledge of XY can enhance this program using scripting. I hope that Don does not spin out the development of as many new features in scripting that he can devise as the potential is mind blowing.

As a personal view DP fades into obscurity by comparison and if it comes to attracting new buyers then I think scripting and its application will be far more successful = why - DP is commonly available but scripting is very restricted especially when the full operands are available.

Great stuff!

RalphM
Posts: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Post by RalphM »

It really is impressive - and btw that's probably the longest post ever posted in this forum so far AFAIK.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

eurytos
Posts: 200
Joined: 29 Jan 2008 15:53

Post by eurytos »

Wow!


Thanks Jacky!!!!!

This looks great, I will have to play with it over the weekend!

admin
Site Admin
Posts: 60601
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: INI Tweaks

Post by admin »

Wow, I feel like Doctor Frankenstein! The things I created get totally out of control... :wink:
jacky wrote:Of course, as goes the commands (which might be a little weird to tell you the truth...)...
What do you mean?

Just tried the script. Mind-blowing!!! :D


About the menu position: Although I see the slight problem of creeping towards the right edge of the screen, I think it's expected that a menu opens at the mouse cursor, and the creeping is not so bad after all.

graham
Posts: 457
Joined: 24 Aug 2007 22:08
Location: Isle of Man

Post by graham »

serendipity wrote:
Update: Infact it should be in XY by default.
I totally agree - this should be in the Tools menu. Unless one takes time to dig into the ini file it is difficult to know what tweaks there are. This solves this dilemma at a stroke.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: INI Tweaks

Post by jacky »

Well, I'm glad you guys like it! :D
admin wrote:
jacky wrote:Of course, as goes the commands (which might be a little weird to tell you the truth...)...
What do you mean?
Well, that when usin getkey we might not get what the current value of the setting is, only what is saved in the INI -- so a setting that has been changed but not yet saved could be returned. As such, this makes it a bit unreliable, at least for everything but INI Tweaks, since those cannot be changed from XY.

In the same idea, using setkey doesn't mean anything unless there's a "restart without saving" that follows. So some setkey might not do anything, or a restart has to be forced (and that can be a bit of a PITA I'd say), not to mention that one has to remember to save before using such scripts in order not to loose recent config changes (including MRU, Color Filters, Highlighted Folders, current path...)
admin wrote:About the menu position: Although I see the slight problem of creeping towards the right edge of the screen, I think it's expected that a menu opens at the mouse cursor, and the creeping is not so bad after all.
Well, I think it depends on what menu you use. Here it might not be too bad, but I have some other scripts where it's not as nice, and as I explained in the other post, I thought putting the first popup at mouse position but then others using the same one might be better.

To tell you the truth though, the other point (specifying multiple script ids to "construct" a menu not showing all items) is the one I care more about, because it could really makes some scripts more powerful.
I have other scripts like this one where using multiple files I fell is just a PITA, especially where there's some common functions that would have to be duplicated, go maintain such a mess easily then!
But with this improvment, one could decide to show the full menu, or only specific items depending on whatever criteria are appropriate, and all of that within one single file. Now that'd be pretty cool, and would really expand possibilities!
Proud XYplorer Fanatic

eurytos
Posts: 200
Joined: 29 Jan 2008 15:53

Post by eurytos »

Jacky,

Is the ini file required to be in the default xyplorer folder or is it ok to have it stored in a different location?

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

eurytos wrote:Is the ini file required to be in the default xyplorer folder or is it ok to have it stored in a different location?
Well, everything is all handled by XY's script commands, which uses the currently loaded INI file. And all INI files must be in <xydata> to work, as per XY rule.
Proud XYplorer Fanatic

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

This script doesnt work for me in 0018 beta. Works fine on 0015 beta.
Anybody else?

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

serendipity wrote:This script doesnt work for me in 0018 beta. Works fine on 0015 beta.
Anybody else?
Yes, that's because I used "<crlf>" in there, which has now become an XY variable/constant, thus the confusion.

Here's a quickly updated version of the script, which will not work with version below 0018 as it also uses the new load syntax, just for fun ;)

Code: Select all

"!! READ FIRST !! : init"
	msg "Welcome to the INI Tweaks Script !<br><br>Please remember that any changes made through this script will require to restart XY without saving changes in order to be taken into consideration.<br>Also, you might want to save your current settings BEFORE making any changes, just in case.";
	sub back;
-
"Show &all tweaks : all"
	load *,"sec1;-;tipG1;tipG2;tipG3;tipG4;tipG5;tipG6;tipG7;tipG8;tipG9;tipG10;-;sec2;-;tipI1;tipI2;tipI3;tipI4;tipI5;tipI6;tipI7;tipI8;-;sec3;-;tipP1;tipP2;tipP3;-;sec4;-;tipT1;-;sec5;-;tipS1;-;sec6;-;tipM1;tipM2;tipM3;tipM4;tipM5;-;back";
-
"&1 - GENERAL : sec1"
	load *,"sec1;-;tipG1;tipG2;tipG3;tipG4;tipG5;tipG6;tipG7;tipG8;tipG9;tipG10;-;back"
"Never Start With A Running Search : tipG1"
	copytext "Never Start With A Running Search/NoFindOnStartup/Settings/If you do not use a Permanent startup path, you may find yourself in a situation where XY will start on a Finding Tab, and as such a Find operation will be initiated as soon as the application is loaded. This can occur, for example, if you save your settings or exit XY with option Save settings on exit enabled, while the active tab is showing search results (i.e. it's a Finding Tab).%crlf%To ensure that there will never be a running search on startup, you can simply enable this tweak.";
	sub _doSwitchSetting;
"No Preview On Startup : tipG2"
	copytext "No Preview On Startup/NoPropertiesStartup/Settings/When XY starts, and if you use the option Save settings on exit, the same state you were in when you closed XY will be restored. This could lead to unexpected behaviors like having the properties and/or preview of the currently selected&focused item to be initiated.%crlf%If you don't want this to happen on startup even when closing XY while previewing an audio or video file for example, enable this setting to ensure this won't happen.";
	sub _doSwitchSetting;
"Auto Focus List After Using Catalog : tipG3"
	copytext "Auto Focus List After Using Catalog/SetFocusToListAfterCatalog/Settings/When you click on an item on your Catalog, the focus will stay on Catalog, unless you clicked an item that points to a file (without using option """"Open on click"""" or the file:/// protocol), then XY does put this file into view on List and give focus to the List.%crlf%If you want to have to focus sent to the List no matter what item you clicked on (eg. folders, """"Open on click"""" items, URLs, Visual Filters, etc) then you can do it by enabling this setting.%crlf%Note that this will only affect items, not categories, and will only apply when clicking on the item or pressing Enter while it's selected. Using middle-click, click while holding Ctrl or Shift, or using context-menu doesn't apply.";
	sub _doSwitchSetting;
"Allow Move On Rename : tipG4"
	copytext "Allow Move On Rename/AllowMoveOnRename/Settings/There's a great """"hidden"""" feature in XY that can allow you to move an item at the same time as you're renaming it. When triggering Rename Mode on List (menu File|Rename (F2)), you will be able not only to specify a new name for the item (file or folder), but also enter a new path for the file ! The path can be relative to the current folder, or an absolute path (even on a different drive !)%crlf%You can use path that don't yet exists. In such a case, XY will create the path on-the-fly and move the item as expected. You can specify multi-folder path that don't exists at all, and XY will create the whole branch.%crlf%You can use absolute path, even specifying other drives or network locations, such as """"D:\Folder\file.ext"""" or """"\\server\share\file.ext""""%crlf%You can also use relative syntax, going either way : down, for example """"folder\file.ext"""" will move the file into subfolder """"folder""""; or up, for example """"..\folder\file.ext"""" will move the file in folder """"folder"""" at the same level that the current location.%crlf%This feature is not enabled by default.";
	sub _doSwitchSetting;
"Most-Recently-Used Lists: Use Match From Beginning Option : tipG5"
	copytext "Most-Recently-Used Lists: Use Match From Beginning Option/AutoCompleteMatchFromBeginning/Settings/At first when you type text while on a control that support MRU (Most-Recently Used) list, the list of items matching what you typed so far was done using the """"match from beginning"""" option. From version 6.80.0027 onwards, XY now uses the """"match anywhere"""" option, so if item """"C:\Program Files\XYplorer"""" is on your MRU list, you can simply type """"XY"""" and it will match.%crlf%However if you would rather use the """"match from beginning"""" option (where you would have needed to enter """"C:\Program Files\XY"""" to match the same item, you can enable it with this setting.";
	sub _doSwitchSetting;
"New Folder Templates : tipG6"
	copytext "New Folder Templates/Folder0/NewTemplates/On different occasions XYplorer will allow you to copy, move or paste items into a newly created folder ; namely through the extended drag&drop (Move/Copy Here to New Subfolder) or clipboard (Paste Here to New Subfolder...).%crlf%XY will have four different default names you can use if you want for this newly created folder. The first three come from templates in the INI, while the last one is the name (minus its extension) of the focused item at the time/while starting the drag (ie the one you start the drag&drop from).%crlf%Those are date/time sensitive so you must escape characters using backslash ( \ ).%crlf%Note that you are here only editing """"Folder0"""" which is also used when creating new folder (Ctrl+N), so edit the others please do it manually.";
	sub _doTextSetting;
"Show File Info Tips Only When Holding Shift : tipG7"
	copytext "Show File Info Tips Only When Holding Shift/FileInfoTipHoldShift/FileInfoTips/When showing file info tips, XY must get some information about the hovered item in order to show them on the info tip. This process can take some time, thus slowing you down a little and you may experience a high CPU usage when moving the mouse over the List, especially with large files that needs to be accessed, such as videos for example.%crlf%To reduce this, you can use option Show tip only when hovering file icon to have file info tips to pop up only when you move the mouse over an item's icon (otherwise it's over icon or file name).%crlf%You can also/instead use another trick, which will make XY only show the file info tooltip when the Shift key is held down. That way, you'll only get the info tips when you specifically ask for them.";
	sub _doSwitchSetting;
"Change Unit Caption : tipG8"
	copytext "Change Unit Caption/""UnitByte""/General/You can change the text used for unit when showing a size in bytes (statusbar, reports, etc).";
	sub _doTextSetting;
"Show Hidden Shares : tipG9"
	copytext "Show Hidden Shares/ShowHiddenShares/Settings/By default hidden shares are, well, hidden, and as such not automatically shown on Tree, unless you go there (using Address Bar, Go to, etc). If you want such hidden shares to be shown automatically shown, enable this setting.";
	sub _doSwitchSetting;
"Only Display List Content When Done : tipG10"
	copytext "Only Display List Content When Done/NoDisplayBeforeSort/Settings/When changing location, XY usually does display List content only after all items have been retrieved and sorted. But, when the file list is large and takes longer to fill, the some preliminary contents are shown as XY process continues. For instance, the List is first filled with items as they are retrieved, and then once again after all items have been retrieved and sorted.%crlf%Enabling this setting will have XY not draw/display anything until all items have been retrieved and sorted.%crlf%Note that this setting doesn't apply to Find mode / search results : items will always been added as they are found, and the List sorted once the search is complete.";
	sub _doSwitchSetting;
-
"&2 - INTERFACE : sec2"
	load *,"sec2;-;tipI1;tipI2;tipI3;tipI4;tipI5;tipI6;tipI7;tipI8;-;back"
"Change Row Height in List : tipI1"
	copytext "Change Row Height in Tree/TreeItemDistY/Settings/As you may already know, you can reduce the horizontal space used on your Tree by using the option Narrow Tree. But if that's not enough for you, you can also change the vertical space used!%crlf%XY allows you to define the row height that will be used on Tree, List and Catalog independently.%crlf%The value you must entered is not the row's height per-se, as it may vary depending to the font used, but by how many pixels should the row's height be increased. You can enter values from -2 to 16, so you can actually reduce the row's height using negative values.%crlf%For more information about this, and another easier/quicker way to change this values, please refer to the XYwiki.";
	sub _doNumericSetting;
"Show Accessed Time : tipI2"
	copytext "Show Accessed Time/NoAccessedTime/Settings/Each and every file/folder on your computer has 3 dates : Created date, Modified date, and Accessed date. That last one indicates the last time the item was """"accessed"""", even if no modifications were done. Unlike the other two dates, and on FAT32 drives, only the actual date (ie. no time) is stored, resulting in lots of """"00:00:00"""" everywhere on the Accessed column.%crlf%If you're tired of seeing those, XY lets you shorten the column by only showing the date (dd/mm/yyyy) without any time info. Note that this will also be in effect on the Properties tab on the Panel, and will NOT be restricted to FAT32 drives. So, if you have both FAT32 and NTFS drives (which do store a time value) it's up to you to decide: have 00:00:00 on FAT32, or don't show the (known) time on NTFS.%crlf%By default XY does show the time info, so to strip it down simply change enable setting.";
	sub _doSwitchSetting;
"Do Not Use Icons For User-Defined Commands Menu : tipI3"
	copytext "Do Not Use Icons For User-Defined Commands Menu/UDCNoMenuIcons/Settings/XY has a very powerful feature, User-Defined Commands (or UDC), which allow you to create your own """"commands"""" with predefined parameters and options. One way to access those commands is through the menu User and by default XY will try, whenever possible, to use an icon corresponding the command (for example, a command to """"Open With"""" the notepad would have the icon of notepad.exe used)%crlf%If, for some reason, you did not want such icons to be used, you can enable this setting.";
	sub _doSwitchSetting;
"Change Tree Autoscroll Position : tipI4"
	copytext "Change Tree Autoscroll Position/TreeRowForAutoScroll/Settings/As you know, the Tree always (if necessary) moves the current node (folder) into view when you browse by means other than the Tree (eg. using Catalog). Now there's a way to control where exactly the current node will be positioned within the view port (the part of the Tree currently visible).%crlf%If you set the value to 1 (2, 3, etc.) then the current folder, if not visible already without scrolling, will be auto-positioned at row 1 (2, 3, etc.) (if possible). If the value is 0, then the internal strategy is to scroll as little as possible to keep the current node visible, which is the way it was until v5.80.0002.";
	sub _doNumericSetting;
"Change Tree Position When Putting Focused Item Into View : tipI5"
	copytext "Change Tree Position When Putting Focused Item Into View/TreeRowForDblClickScroll/Settings/A little tip you might already know: if you double-click on an empty area on Tree, it will automatically scroll (if needed) to put the selected node (ie. current folder) into view, unless you have option Dbl-click on empty space goes up. This can also be done using Shift+F6, and can be pretty useful after you scrolled up/down, during drag&drop or for copying/moving files for example.%crlf%When doing this, XY will put the selected node back on the first row (if possible). If for some reason you don't like that, and prefer to use another row, here's your chance!";
	sub _doNumericSetting;
"Use Your Own Titlebar : tipI6"
	copytext "Use Your Own Titlebar/TitlebarTemplate/General/The titlebar of the main window of XYplorer, also used on taskbar, etc, reads as follow : [Current Location] - XYplorer @ [Filename.ini] - v[version number]%crlf%This title is actually highly customizable, as it follow a template you can adjust according to your needs/liking by tweaking your Configuration file. By default, this template used is : """"<path> - <app> @ <ini> - <ver>""""%crlf%As you can see, you can easily have the titlebar of XY set as you wish. The variables at your disposal are : %crlf%<path> : current location%crlf%<app> : the base of the filename of the currently running EXE file%crlf%<ini> : the name of the Configuration file in use%crlf%<ver> : version number%crlf%Please note that <app> is required, and must be surrounded by spaces. And as mentioned, its value is not a strict constant, but made out of the name of the running EXE, stripped of its extension. This allows you to have more than one instance running and easily identify them, renaming XYplorer.exe to something like XY-USB.exe or XY-Desktop.exe%crlf%This feature is only available to registered users. Trial version will use following template: """"<path> - <app> @ <ini> - <ver> ### 30-day Trial Version ###""""%crlf%Note that if you enabled the WOW64 File Redirection (available only on 64-bit Windows, menu View|Show Items|WOW64 Redirection (64-bit only) then """" - WOW64"""" will be appended to the window's title.";
	sub _doTextSetting;
"Popup Full Favorites Menu As Tree Context Menu : tipI7"
	copytext "Popup Full Favorites Menu As Tree Context Menu/PopupFullFavMenu/Settings/When right-clicking on an empty area on Tree, XY will pop up your list of Favorite Folders, if you have any. Otherwise, it will pop up the full Favorites menu instead. If you want to have the full menu to be popped up even when you have Favorite Folders defined, enable this setting.";
	sub _doSwitchSetting;
"Popup Menus At Selection : tipI8"
	copytext "Popup Menus At Selection/PopupMenusAtSelection/Settings/When popping menus up the menu usually pops up at mouse position. This is very convenient when using the mouse, but for keyboard-oriented people this might not be the most convenient way to go, especially for all menus popped up using a keyboard shortcut. If you enable this setting you will have all menus to pop up on the top-left corner of Tree or List depending of what menu is triggered.%crlf%In the mean time, context menu of items in Tree, List and Catalog will be positioned at the selected/focused item, if the menu is triggered by key.";
	sub _doSwitchSetting;
-
"&3 - PREVIEW : sec3"
	load *,"sec3;-;tipP1;tipP2;tipP3;-;back"
"Add Custom Image Formats to Preview : tipP1"
	copytext "Add Custom Image Formats to Preview/ImagePreviewCustomExtensions/Settings/You can add your own file types (extensions) of Image Previewed formats. Just like for Audio/Video formats you can define new extensions that XY should try to preview for Images. The value must be: <dot>extension[<dot>extension]<dot>%crlf%For example, to add *.new and *.ext files use: """".new.ext."""" (without quotes)%crlf%Note that those will NOT be shown on the list of supported formats in the Configuration window.";
	sub _doTextSetting;
"Add Custom Audio/Video Formats to Preview : tipP2"
	copytext "Add Custom Audio/Video Formats to Preview/MediaPreviewCustomExtensions/Settings/You can add your own file types (extensions) of Audio/Video Previewed formats. As you know XY can basically preview all formats that are supported by Windows (and the WMP). So you may have installed some codecs for files that XY doesn't include in its list of audio/video previewed formats, while it could actually play them!%crlf%The value must be: <dot>extension[<dot>extension]<dot>%crlf%For example, to add *.new and *.ext files use: """".new.ext."""" (without quotes)%crlf%Note that those will NOT be shown on the list of supported formats in the Configuration window .";
	sub _doTextSetting;
"Add Custom Web/Office Formats to Preview : tipP3"
	copytext "Add Custom Audio/Video Formats to Preview/OfficePreviewCustomExtensions/Settings/You can add your own file types (extensions) of Web/Office Previewed formats. Just like for Audio/Video formats (see above) you can define new extensions that XY should try to preview (using IE integration) for Web/Office. Note that the key might not already exists, if so just create it. The value must be: <dot>extension[<dot>extension]<dot>%crlf%For example, to add *.new and *.ext files use: """".new.ext."""" (without quotes)%crlf%Note that those will NOT be shown on the list of supported formats in the Configuration window .";
	sub _doTextSetting;
-
"&4 - THUMBNAILS : sec4"
	load *,"sec4;-;tipT1;-;back"
"Use Your Own Thumbnails Sizes : tipT1"
	copytext "Use Your Own Thumbnails Sizes/ThumbSizes/Thumbs/When using Thumbnails as Views, XY offers you three different sizes of thumbnails you can use. You can define those from the Configuration, among a list of various pixel sizes for each dimension, for each size.%crlf%But what if you wanted to use another size which is not listed? In that case, you can simply specify which sizes are to be listed, using this setting.";
	sub _doTextSetting;
-
"&5 - SCRIPTING : sec5"
	load *,"sec5;-;tipS1;-;back"
"Switch Recursion Checker Off : tipS1"
	copytext "Switch Recursion Checker Off/ScriptRecursionWarningOff/Settings/When writing your scripts, you might want to have one script call itself (using command load or sub). Of course, if you don't take care, you could end up in an infinite loop which would result in some problems... Trying to prevent such an issue, XY comes with a recursion checker that will pop up a warning message when a recursion is spotted and gives you the opportunity to cancel the script execution.%crlf%If you do not want these warnings and are confident that you won't create an endless loop, you can switch off the recursion checker by enabling this setting.";
	sub _doSwitchSetting;
-
"&6 - MISC : sec6"
	load *,"sec6;-;tipM1;tipM2;tipM3;tipM4;tipM5;-;back"
"Change Format Used When Pasting Image : tipM1"
	copytext "Change Format Used When Pasting Image/ImageFromClipFormat/General/XY allows you to directly paste text or even images, creating new files on-the-fly. Using commands Paste Text Into New Textfile (Ctrl+Alt+V) or Paste Image Into New [EXT] File (Ctrl+Shift+Alt+V) found under menu Edit|Paste Special, a new file will be created with the text (or list of files) in your clipboard, or the current image respectively.%crlf%By default, images are pasted into new PNG file, but you can actually change the format to be used using this setting.%crlf%The possible values for this setting are png, jpg, gif, bmp and tif%crlf%When using JPG format, you can actually control the quality by appending it, from 1 (worst) to 100 (best), for example using jpg90 will use JPG format with a quality quantifier of 90. When no quality is specified (jpg) then a default value of 85 is used.%crlf%Note that the GIF quality is very bad (dithered) and practially unusable. The other formats, however, are of high quality. Also note that this feature requires GDI+.";
	sub _doTextSetting;
"Change The RegExp Rename Patterns Separator : tipM2"
	copytext "Change The RegExp Rename Patterns Separator/""RegExpRenameSep""/General/When doing RegExp Rename operation, you have to define regexp patter and replace pattern separated by a """" > """" (without quotes). If you want to change this pattern, to remove the spaces or use a completely different separator, you can now do so simply by replacing the value of this setting.";
	sub _doTextSetting;
"Set File To Use For Tip Of The Day : tipM3"
	copytext "Set File To Use For Tip Of The Day/FileTipOfTheDay/Settings/To learn new things about XY and discover some """"hidden"""" useful features you may not know about or remember, you can always hit Shift+F1 to open the Tip of the Day. Said tips are loaded from a file named TipOfTheDay.htm found in XY's data folder (<xydata>). You can change the name of the file from which to load the tips, which could turn out to be particularly useful if you want to use translated version of the tips for example.%crlf%Please note that the name for user tips will also be based on this setting, for example if you use MyTips.htm as filename to load the tips from, the user filename will be MyTips_user.htm";
	sub _doTextSetting;
"Add Opened Files To Recent Document List : tipM4"
	copytext "Add Opened Files To Recent Document List/AddToRecentDocs/Settings/If you want, you can have XY to add to the Shell's list of recently opened documents any files opened from XY. Please note that this list isn't available or usable in any way from XY itself.%crlf%To have XY to add opened files to your recent document list, enable this setting.";
	sub _doSwitchSetting;
"Change The Application Data Folder : tipM5"
	msg "Before version 6.80.0063, all the configuration, control and data files that XYplorer uses were stored in the application's path, i.e. the folder where the running XYplorer.exe is located. You can now specify the Application Data folder to be used by XYplorer as any location of your choice by creating a new file called startup.ini.<br>To use this feature, just create a new file called startup.ini in XYplorer's Application Path (where XYplorer.exe is located) and put something like this in it:<br><br>[AppData]<br>Path=D:\XYplorer Data<br>You may also use Environment Variables in the Path= value which has the following benefits:<br>- Move the Application Data folder elsewhere than in ""Program Files"", which may cause ""security problems"" under Vista (as XY requires read/write access in that folder)<br>- Allow each user of the same computer to have their own unique settings (including different Catalog, CKS, etc)<br><br>For example, using a startup.ini file with this : <br><br>[AppData]<br>Path=%appdata%\XYplorer<br><br>Will cause XY to use as its Application Data folder something like C:\Documents and Settings\UserName\Application Data\XYplorer -- thus getting a completely different profile for each user on the computer. <br><br>When using this option, the files which must remain in the Application Path are the following : XYplorer.exe, XYplorer.hlp, XYplorer.cnt and startup.ini.<br>The files which are stored in the Application Data folder are the following : catalog.dat, ks.dat, servers.dat, udc.dat, tipoftheday.htm, tipoftheday_user.htm, XYplorer.ini as well as any alternative INIs (if any), and the two folders FindTemplates and NewItems.<br><br>Naturally, if you change the Application Data folder you will have to copy your current files to the new location if you want to continue using your present configuration, Catalog, etc.";
	load *;
-
"Restart XYplorer without Saving, to apply any changes made : restart"
	#190;
-
"<< &Back : back"
	load *,"sec1;sec2;sec3;sec4;sec5;sec6;-;all;-;restart;-;cancel";
"Cancel : cancel"

"_doSwitchSetting"
	set $data, <clipboard>;
	regexreplace $title, $data, "^(.+?)/.*$", "$1";
	regexreplace $key, $data, "^.+?/(.+?)/.*$", "$1";
	regexreplace $section, $data, "^.+?/.+?/(.+?)/.*$", "$1";
	regexreplace $message, $data, "^.+?/.+?/.+?/(.+)$", "$1";
	
	getkey $current, $key, $section;
	regexreplace $state, $current, "^1$", "enabled";
	regexreplace $state, $state, "^((?!enabled).)*$", "disabled";
	regexreplace $new_state, $current, "^1$", "disable";
	regexreplace $new_state, $new_state, "^((?!disable).)*$", "enable";
	regexreplace $new_s, $current, "^1$", "2";
	regexreplace $new_s, $new_s, "^((?!2).)*$", "1";
	regexreplace $new_s, $new_s, "^((?!1).)*$", "0";

	copytext """ == $title == ""<br>-<br>""Info about this setting""<br>	msg ""$message%crlf%You have this setting currently $state."";<br>	load *;<br>""Switch: $new_state it""<br>	msg ""This setting is currently $state, are you sure you want to $new_state it ?"",1;<br>	setkey $new_s, $key, $section;<br>	msg ""You will NEED to restart XYplorer WITHOUT saving in order to have the change taken into consideration."";<br>	load ""INI Tweaks"",back;<br>-<br>""<< Back""<br>	load ""INI Tweaks"",back;";

	replace $script, <clipboard>, "%crlf%", "<br><br>";
	copytext;
	load $script,,s;

"_doTextSetting"
	set $data, <clipboard>;
	regexreplace $title, $data, "^(.+?)/.*$", "$1";
	regexreplace $key, $data, "^.+?/(.+?)/.*$", "$1";
	regexreplace $section, $data, "^.+?/.+?/(.+?)/.*$", "$1";
	regexreplace $message, $data, "^.+?/.+?/.+?/(.+)$", "$1";

	regexreplace $quotes, $key, "^"".+""$", """""";
	regexreplace $quotes, $quotes, "^((?!"""").)*$", "";
	replace $key, $key, """", "";

	getkey $current, $key, $section;

	copytext """ == $title == ""<br>-<br>""Info about this setting""<br>	msg ""$message%The current value for this setting is: """"$current"""""";<br>	load *;<br>""Set: change value [$current]""<br>	input $new_s, ""Please enter the new value :"",""$current"";<br>	setkey ""$quotes$new_s$quotes"", $key, $section;<br>	msg ""You will NEED to restart XYplorer WITHOUT saving in order to have the change taken into consideration."";<br>	load ""INI Tweaks"",back;<br>-<br>""<< Back""<br>	load ""INI Tweaks"",back;";

	replace $script, <clipboard>, "%crlf%", "<br><br>";
	copytext;
	load $script,,s;

"_doNumericSetting"
	set $data, <clipboard>;
	regexreplace $title, $data, "^(.+?)/.*$", "$1";
	regexreplace $key, $data, "^.+?/(.+?)/.*$", "$1";
	regexreplace $section, $data, "^.+?/.+?/(.+?)/.*$", "$1";
	regexreplace $message, $data, "^.+?/.+?/.+?/(.+)$", "$1";
	
	getkey $current, $key, $section;

	copytext """ == $title == ""<br>-<br>""Info about this setting""<br>	msg ""$message%crlf%The current value for this setting is: $current"";<br>	load *;<br>""Set: change value [$current]""<br>	input $new_s, ""Please enter the new value :"",$current;<br>	incr $new_s, $new_s;<br>	incr $new_s, $new_s, -1;<br>	setkey $new_s, $key, $section;<br>	msg ""You will NEED to restart XYplorer WITHOUT saving in order to have the change taken into consideration."";<br>	load ""INI Tweaks"",back;<br>-<br>""<< Back""<br>	load ""INI Tweaks"",back;";

	replace $script, <clipboard>, "%crlf%", "<br><br>";
	copytext;
	load $script,,s;
Proud XYplorer Fanatic

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

Oh yes, I missed that part in today's beta.
Thanks Jacky.

Pagat
Posts: 306
Joined: 09 Oct 2007 21:23
Location: Austria

Post by Pagat »

Nice script indeed!

I also added an option to save current settings (#182) so that i don't have to think of doing so before executing the script :)

Post Reply