Script and Keyboard Shortcut Doesn't Work in Search Results

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Script and Keyboard Shortcut Doesn't Work in Search Results

Post by Jerry »

I have a script for normalizing selected file names. The script and associated keyboard shortcut work fine with selected files in any regular tab. But for some reason, in the Search Results tab, the keyboard shortcut doesn't work at all and when I try to run the script directly (via User/Run Script), it only acts on one of the multiple selected files.

The search I did is a Regexp "mp3$" on a top level folder containing the mp3 files in 3 sub-folders. I select all the files and then try to run the script shown below: (My keyboard shortcut is Shift-Alt-C.)

Code: Select all

rename s, "_/ "; 
  rename r, "(\w)-(\w) > $1 - $2";
  rename r, "^(\d+)\s+(\w) > $1 - $2";
  #126;
Using 10.40.0000. I don't know if this is a new problem or not, because this is the first time I ran the script this way and noticed the problem.
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

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

Re: Script and Keyboard Shortcut Doesn't Work in Search Resu

Post by admin »

Confirmed. It's not really a bug but the fact the multiple selections were lost after each special rename (nothing to do directly with scripting).

I could improve it as follows:

Code: Select all

    * Rename Special: Before, when renaming multiple items in Search 
      Results, the search was repeated after the rename and the multi-
      selections were lost. Now, this happens only when folders are 
      among the renamed items AND the search did include subfolders.
If multiple folders are renamed in a recursive Search Results list then updating the list data while retaining the selections becomes pretty complex. I'll look at it again somewhen later...

Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: Script and Keyboard Shortcut Doesn't Work in Search Resu

Post by Jerry »

Ok, and I see now that the reason my Shift-Alt-C shortcut doesn't work is because Alt-C is an accelerator for the Selected locations checkbox in the Find Files/Names & Location panel.

But, 3 questions:
  • Why does the search still repeat in this way when Auto-Refresh is temporarily turned off (from the View Menu)?
  • Why can't the Suspend Auto-Refresh option be toggled off (when Auto-Refresh is still on globally) when in the Search Results tab?
  • Why is the right click context menu restricted to a subset of the items in the regular context menu. Particularly, items I use for external programs don't show up.
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

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

Re: Script and Keyboard Shortcut Doesn't Work in Search Resu

Post by admin »

Jerry wrote:Ok, and I see now that the reason my Shift-Alt-C shortcut doesn't work is because Alt-C is an accelerator for the Selected locations checkbox in the Find Files/Names & Location panel.

But, 3 questions:
  • Why does the search still repeat in this way when Auto-Refresh is temporarily turned off (from the View Menu)?
  • Why can't the Suspend Auto-Refresh option be toggled off (when Auto-Refresh is still on globally) when in the Search Results tab?
  • Why is the right click context menu restricted to a subset of the items in the regular context menu. Particularly, items I use for external programs don't show up.
1. It's a an internal refresh, not an auto-refresh.
2. Search Results don't auto-refresh. It's a design decision from years ago.
3. The context menu does not work correctly for items from multiple locations. It's THE mystery of all mysteries and I could never solve it in 14 years. I know that xplorer2 has solved it, but the solution is such a frightening hack that I did not dare to try it. :wink:

Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: Script and Keyboard Shortcut Doesn't Work in Search Resu

Post by Jerry »

admin wrote:
Jerry wrote: I know that xplorer2 has solved it, but the solution is such a frightening hack that I did not dare to try it. :wink:
Oh, are you writing xyplorer2 in a different language and platform and if so, what is that?
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

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

Re: Script and Keyboard Shortcut Doesn't Work in Search Resu

Post by admin »

Jerry wrote:
admin wrote:
Jerry wrote: I know that xplorer2 has solved it, but the solution is such a frightening hack that I did not dare to try it. :wink:
Oh, are you writing xyplorer2 in a different language and platform and if so, what is that?
No, not xyplorer2 but xplorer2 , it's another file manager. :)

Jerry
Posts: 835
Joined: 05 May 2010 15:48
Location: The UnUnited States of America

Re: Script and Keyboard Shortcut Doesn't Work in Search Resu

Post by Jerry »

Just tried things with the 10.40.0005 beta and the script now works fine. Thanks.
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB. SCREEN SCALING: 125%

Post Reply