Re: Expanding "CEA_ListRightClickOnWhite=XXX" Tweak
Posted: 08 Mar 2015 13:03
Just so you know, it does work already without the ";" at the end.admin wrote:...so I will make it work even without :: and ;.
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Just so you know, it does work already without the ";" at the end.admin wrote:...so I will make it work even without :: and ;.
But not without both, :: and ;.klownboy wrote:Just so you know, it does work already without the ";" at the end.admin wrote:...so I will make it work even without :: and ;.
As, in general, a script line has to be ended with semicolon, this sounds quite OK, I think.admin wrote:But not without both, :: and ;.
Code: Select all
CEA_ListRightClickOnWhite_Script=::load "D:\Tools\XYplorer\Scripts\vTB.xys"; Code: Select all
CEA_ListRightClickOnWhite_Script=load "D:\Tools\XYplorer\Scripts\vTB.xys"These aren't values. These are commands to pull up the existing menus which have no alternatives today.klownboy wrote:Hi TheQwerty, are you thinking of the possibility for on-the-fly changing of these values via scripting or simply the ease of changing them with scripting?
You're making it much more complicated than it needs to be. There's no need to change the value of CEA_*_Script on the fly. Set them each to a script file and that script file is responsible for determining what to do and doing it.klownboy wrote:It would be quite a cool feature if the referenced script in "CEA_ListRightClickOnWhite" could be changed immediately via a script without the need for saves. Multiple scripts could be used depending on the situation or need.
Code: Select all
/*#############################################################################\
TreeRightClickOnWhite.xys
Script versions of the various tweaks available for CEA_TreeRightClickOnWhite as
of March 9, 2015.
Suggested INI tweaks:
CEA_TreeRightClickOnWhite=6
CEA_TreeRightClickOnWhite_Script=::Load 'CEA\TreeRightClickOnWhite';
This makes all of the original tweaks available and allows you to change the
behavior without restarting XY.
[ABOUT]
Author = TheQwerty
Version = 1.0
Date = 2015-03-09 13:13z
Requires = XYplorer v14.80.0245
[]
\#############################################################################*/
/*******************************************************************************
** Show Menu
** Single entry point into script to easily modify the displayed menu.
*******************************************************************************/
"Show Menu||1 : showMenu"
$menu = <<<MENU
_favs
_favFiles
_favsFull
-
_drives
_drivesSpecial
-
_tabsAll
_tabsPane
MENU;
$menu = RegexReplace($menu, '(\r?\n)+', ';');
Load '*', $menu;
"0 <get MenuCaption 550>|:favs|1 : _favs"
#550; // Favorites | Favorite Folders | - submenu -
"1 Favorites Main Menu : _favsFull"
popupmainmenu 'favorites';
"2 <get MenuCaption 526>|:drives : _drives"
#526; // Go | Drives...
"3 <get MenuCaption 526> + <get MenuCaption 551> : _drivesSpecial"
// Build drive list
$drives = '';
foreach ($drive, Get('Drives')) {
$drives = <<<DRIVE
$drives
"$drive - <get DriveName $drive 1>|$drive" goto '$drive';
DRIVE;
}
$script = <<<SCRIPT
"%computer%|%computer%" goto '%computer%';
-
%desktop%
%personal%
%username%
-
$drives
-
"%net%|%net%" goto '%net%';
"%recycler%|%recycler%" goto '%recycler%';
SCRIPT
Load $script,, 's';
"4 <get MenuCaption 690>|:tablist : _tabsAll"
#690; // Panes | Tabs | - submenu -
"5 <get MenuCaption 564>|:favfiles : _favFiles"
#564; // Favorites | Favorite Files | - submenu -
"# <get MenuCaption 538>|:tablist : _tabsPane"
#538; // Go | Tablist...Yeah I know bad terminology, but I'm using value term generically, these values equate to commands.TheQwerty wrote:These aren't values. These are commands
Why do you insist on making it so complicated?klownboy wrote:That's a great idea/script, but not what I was talking about. I'm talking about changing the script resource file itself when the assigned value of CEA_ListRightClickOnWhite=6 or CEA_TreeRightClickOnWhite=6 so the script itself is changed in CEA_ListRightClickOnWhite_Script=load "D:\Tools\XYplorer\Scripts\vTB.xys". In other words, I think it would be an even better idea when the tweak value is "6", be able to change the assigned script resource file on the fly. In your case you're using the script resource file to access the other commands which is great but not what I was suggesting (though I'm sure it wasn't clear).
The script you supply to CEA_*RightClickOnWhite_Script can do anything you desire, it doesn't have to be a menu.klownboy wrote:Hi TheQwerty, I see your point and don't get me wrong I think your idea to run a menu of actions is great, but I still think there is somewhat of a difference in bringing up a menu to select actions or scripts when you right click on white, versus the immediately running of scripts - script resource files - which can be changed by other scripts. No big deal, but that's all I was saying.
Code: Select all
"Show Menu" //doesn't always show a menu now...
if (<curpath> LikeI "<xydata>*) {
Load 'CEA\XYDATA_Menu.xys',, 'f';
} elseif (<curpath> LikeI "%windows%*") {
Echo 'Access Denied!';
} elseif (<curpath> LikeI 'paper:*') {
#770; // View | Paper Folders | - submenu -
}Yes, it was non-menu scripts that I originally had in mind, when I requested it. Though the menu scripts like Vertical Toolbar script do seem ideal for this situation. We could even set a script up to perform different actions based on the current file extension in addition to what you mentioned <curpath> since the right click on White Space doesn't affect the currently selected file. If it's an image open it with ImageEye, if it's a video run Media Player Classic etc. It could be another way to execute/open a file in addition to PFA. I have another script set to do something similar by hitting shift-enter on a selected file.TheQwerty wrote:CEA_*RightClickOnWhite_Script can do anything you desire, it doesn't have to be a menu