Minor scripting related wishes (a generic thread)

Features wanted...
PeterH
Posts: 2776
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Minor scripting related wishes (a generic thread)

Post by PeterH »

@Don: sorry but I just seem to misunderstand / misinterpret what you said, especially regarding multiple selectable (i.e. not hidden) scripts.
And: I often do "misuse" hidden scripts as kind of subroutines, with much success. (While I interpret you say this is not intended?)

@klownboy: have you checked the scripting function "popupmenu()"? Using it you could:
- load one explicite script
- do neccessary common code (just what you requested here)
- maybe dynamically build a list, then...
- call popupmenu for selection what to do
- from the returnvalue of popupmenu select how to continue

In help there are some examples to show what can be done with popupmenu...

This way everything is in your hands - maybe not as comfortable as with automatic selection of script.

So there are 3 levels of selection:
1) by button definition
2) by selection of multiple scripts in a script file
3) by using popupmenu() in a script file
W7(x64) SP1 German
( +WXP SP3 )

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

While I was asleeep on the other side of the pond, you've been discussing this in some detail. I understand there might be issues that surface, but to be honest I'd be happy for now if you could have a tweak or change that would eliminate that imtermediate menu item from displaying just as it doesn't when called with the CTB left click. Why should they be different when called the exactly the same way (i.e., load-script- _hidden label)? When the underscore is removed on both the left and right click CTB command and also within the script, the left click give this result as expected and the right click gives the same result "rightclicked" as shown in my first post. And again, you have to click on "rightclicked" menu item before a similar menu appears as the left click menu.
left click not hidden.JPG
left click not hidden.JPG (14.23 KiB) Viewed 2738 times
I'm not sure why they should have to behave differently.
I have a number of menu scripts that pop up immendiately on both the right click and left click, but of course they are accomplished without the load script label.

Keep in mind that my goal in this was to devise a way to display variable or different information immediately on the left and right click menu through the use of a variable and all in one script. In this case, I used <clipboard> to display information immediately upon display of the menu (in this case, "no ToolBar" and "with ToolBar"). It does work on both the left and right click menus, but I obviously didn't want to see the intermediate menu. It doesn't appear we can use an assigned variable in a menu label only a "built-in" variable.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

Thanks PeterH,
I must have posted my last post immediately after you posted. I've been meaning to dabble a little with popupmenu() and possibly incorporate it in a script. I'll have to review the help and try it.
By the way, have you had any success or examples where you were able to use a variable of some type in a menu (i.e., actually displayed as a menu item)? As I said in my last post, that was the only reason I was once again facing the issue with the intermediate right click menu popping its ugly head when using load-script-label. :)
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

PeterH
Posts: 2776
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Minor scripting related wishes (a generic thread)

Post by PeterH »

klownboy wrote:Thanks PeterH,
I must have posted my last post immediately after you posted. I've been meaning to dabble a little with popupmenu() and possibly incorporate it in a script. I'll have to review the help and try it.
By the way, have you had any success or examples where you were able to use a variable of some type in a menu (i.e., actually displayed as a menu item)? As I said in my last post, that was the only reason I was once again facing the issue with the intermediate right click menu popping its ugly head when using load-script-label. :)
Thanks,
Ken
Fine: both posts in the same minute :appl:

Display a variable in a menu: I had some hope for permanent variables - but had no success in tests. So you maybe had to try it with a feature request...
But I think if you do have a menu, you could push it down to popupmenu() - and then you can build it's entries as you like, i.e. with whatever info you want.

To your wish for direct execution on right-click: I'm afraid it's against some standard - as right click usually is expected to show some dflt like customize. "In principle" this could be changed - but it would be against what people expect, I think. So I'd understand if Don doesn't want to change it.
W7(x64) SP1 German
( +WXP SP3 )

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

Hi PeterH,
I haven't had any luck either in using a permanent variable to display in or as part of a menu item. That's why I resorted to using a built-in variable like <clipboard>. It worked fine. I just didn't want to deal with seeing the intermedate menu before the real menu when right clicking on a CTB. I know other built-in variable like <date> work fine also. So I suppose we could set other built-in XY or Windows variable and have it display as well.

Don was able to make the "Click, Edit and Customize menu" disappear with a tweak (or I should say not display), so I suppose I was hoping he might be able to do the same with that intermediate rightclick menu.

I've been tinkering with "popupmenu()" since you mentioned it. It does open up some new possibilities though it doesn't have the flair that the normal CTB menus have since it doesn't support icons in the menu items. In searching the forum, I was surprised though that there really isn't much out there on popupmenu() especially in the script area. Is hardly anyone using it? I'll continue to experiment.

Thanks again,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: Minor scripting related wishes (a generic thread)

Post by serendipity »

klownboy wrote: In searching the forum, I was surprised though that there really isn't much out there on popupmenu() especially in the script area. Is hardly anyone using it?
I do use it in some scripts which are work related, but i did make one for fun which I'll publish for the fun of it.
Will post a link here soon.
Update:
Here it is: http://www.xyplorer.com/xyfc/viewtopic. ... 639#p80639

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

Thanks serendipity for posting the popupmenu() script, PopUpExplorer.xys here http://www.xyplorer.com/xyfc/viewtopic. ... 639#p80639
It's a good example and learning tool.
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

Hi Don,
I know you've done some changes regarding perm variable lately. Is there any chance you could make a change, feature or tweak that would allow a permanent variable to display in a menu item? A number of XY scripters and would be scripters like myself could really get some use out of that. Currently, only built-in XY variables (e.g., <clipboard>, <curitem>) and Windows envirnmental variables (e.g.,%OS%) will display in a menu.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

No, sorry, too many side effects.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

It's nice that Get SC retrieves some lists but it is time to deprecate those and add a function to get any list.

My, rather obvious, proposal:

Code: Select all

    + Scripting got a new function.
        Name: getList
      Action: Returns the specified list.
      Syntax: getlist(list, [separator=CRLF])
          list:  The list to return, corresponding to List Management;
                 Can be any of the following:
                             goto:  Address Bar & Go to
                              pfa:  Portable File Associations
                          history:  History
                         minitree:  Mini Tree
                           mcb_to:  Move/Copy/Backup To
                    mru_locations:  Recent Locations
                        mru_files:  Recently Opened Files
                     mru_catalogs:  Recent Catalogs
            mru_included_catalogs:  Recently Included Catalogs
                   mru_tabsets_p1:  Recent Tabsets Pane 1
                   mru_tabsets_p2:  Recent Tabsets Pane 2
                      fav_folders:  Favorite Folders
                        fav_files:  Favorite Files
                      highlighted:  Highlighted Folders
                            boxed:  Boxed Branches
                    color_filters:  Color Filters
                             tags:  Tag List
                     tagged_items:  Tagged Items
                      sel_filters:  Selection Filters
                   visual_filters:  Visual Filters
                    power_filters:  Power Filters
                          aliases:  Aliases
                       find_names:  Find Files: Name
                   find_locations:  Find Files: Location
                    find_excluded:  Find Files: Excluded Items
                quick_name_search:  Quick Name Search
                     rename_batch:  Rename Special: Batch Rename
                     rename_regex:  Rename Special: RegExp Rename
                    rename_search:  Rename Special: Search and Replace
                        clipboard:  Files in Clipboard
                     server_cache:  Servers in Network Folder
          [separator]:  String to place between items.
                        Defaults to CRLF (line feed).
      Return: The specified list.
              Format is the same as List Management's Editor Mode.
This would allow a CTB workaround for the limitation seen here, and would provide the means for some much more interesting scripts.


I'm proposing this be a very simple function, and not include the tokenizing flags as seen in Get('list_hilitefolder').
To make up for that I have an enhancement request for formatlist percolating, but it is by no means "minor". :P

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Minor scripting related wishes (a generic thread)

Post by SkyFrontier »

(on TheQwerty's suggestion) ...perhaps adding something to finally retrieve all deleted items (sorted by generic info like when and type of deletion or not) on a session. Yesterday (last recent usage case) I had to track deletion of groups selected via selection filter, an unnecessarily hard-to-do task...
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

TheQwerty wrote:It's nice that Get SC retrieves some lists but it is time to deprecate those and add a function to get any list.

My, rather obvious, proposal:

Code: Select all

    + Scripting got a new function.
        Name: getList
      Action: Returns the specified list.
      Syntax: getlist(list, [separator=CRLF])
          list:  The list to return, corresponding to List Management;
                 Can be any of the following:
                             goto:  Address Bar & Go to
                              pfa:  Portable File Associations
                          history:  History
                         minitree:  Mini Tree
                           mcb_to:  Move/Copy/Backup To
                    mru_locations:  Recent Locations
                        mru_files:  Recently Opened Files
                     mru_catalogs:  Recent Catalogs
            mru_included_catalogs:  Recently Included Catalogs
                   mru_tabsets_p1:  Recent Tabsets Pane 1
                   mru_tabsets_p2:  Recent Tabsets Pane 2
                      fav_folders:  Favorite Folders
                        fav_files:  Favorite Files
                      highlighted:  Highlighted Folders
                            boxed:  Boxed Branches
                    color_filters:  Color Filters
                             tags:  Tag List
                     tagged_items:  Tagged Items
                      sel_filters:  Selection Filters
                   visual_filters:  Visual Filters
                    power_filters:  Power Filters
                          aliases:  Aliases
                       find_names:  Find Files: Name
                   find_locations:  Find Files: Location
                    find_excluded:  Find Files: Excluded Items
                quick_name_search:  Quick Name Search
                     rename_batch:  Rename Special: Batch Rename
                     rename_regex:  Rename Special: RegExp Rename
                    rename_search:  Rename Special: Search and Replace
                        clipboard:  Files in Clipboard
                     server_cache:  Servers in Network Folder
          [separator]:  String to place between items.
                        Defaults to CRLF (line feed).
      Return: The specified list.
              Format is the same as List Management's Editor Mode.
This would allow a CTB workaround for the limitation seen here, and would provide the means for some much more interesting scripts.


I'm proposing this be a very simple function, and not include the tokenizing flags as seen in Get('list_hilitefolder').
To make up for that I have an enhancement request for formatlist percolating, but it is by no means "minor". :P
Thanks for the perfect layout, but still this would be a lot of work, and after all it's only useful for configuring the tool. Automating configuration has less priority than some other things on my list.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Minor scripting related wishes (a generic thread)

Post by highend »

@TheQwerty

Great suggestion! I hope Don finds the time to implement that, would make scripting a lot easier because we don't have to use dirty workarounds to get some of them.
One of my scripts helped you out? Please donate via Paypal

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

admin wrote:after all it's only useful for configuring the tool. Automating configuration has less priority than some other things on my list.
Sorry but you're wrong. :P
There are uses beyond configuration (notice I did not wish for SetList yet... ;)).

I have a script for extracting archives and would love to offer Favorites as target locations.

There's a popular script for using tab sets which I am sure would like easier access to the Recent Tabsets lists.

Likewise with scripts which aid tag, filter, and catalog management, or those simplifying complex rename patterns.

Access to the filter lists could create much more powerful CTBs, and even allow adding items to manage the lists. It would be possible to create a Mega Power Filter CTB that combines your two menus into one which may fit the user better.

This could be helpful to the Listary people (person?) in improving the integration with XY.

Now you are right it would be useful for configuration as well...
SkyFrontier could use a caller script to backup the lists before editing.

zer0 could have a better workaround to the GUI pains with the existing List Manager's inability to easily jump between lists (okay this one might actually require SetList to work well...).

There are people that want a better way of managing and syncing only parts of configurations between multiple computers that might find this useful.


I'm honestly surprised that this is a lot of work, I didn't expect retrieving the lists to be that difficult, but I understand if it is and that causes you some hesitation. However, I hope you reconsider your view of this as nothing more than configuration automation in assigning it a slot on the road map. 8)

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

OK, looks like you have a point there. It can be useful indeed.
TheQwerty wrote:I'm honestly surprised that this is a lot of work, I didn't expect retrieving the lists to be that difficult, but I understand if it is and that causes you some hesitation. However, I hope you reconsider your view of this as nothing more than configuration automation in assigning it a slot on the road map. 8)
It is difficult. List Management makes it look easy and straightforward, but under the hood there is blood sweat and tears.

Post Reply