ListManagementHouseCleaning

Discuss and share scripts and script files...
Post Reply
klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

ListManagementHouseCleaning

Post by klownboy »

ListManagementHouseCleaning.xys Version 1 ListManagement is extremely useful, but I wanted to be able to quickly access numerous List Management items without going back and forth to open them. After a period of time, I like to clean house completely on some list items or on others simply weed out entries or edit them like, Address Bar Recent Locations, Recently Opened Files, etc. Whatever you want to do in List Management, this script is intended to make access easier when you want to clean/clear or edit multiple List Management items. It will provide you with a list of them and you can quickly check off the ones you'd like to clear or edit and it will then open each one in succession. After editing all of them it will provide you the opportunity to save everything. You don't have to at that point, but if you exit XY without saving the changes will be lost.

Application | Use: Make a customized toolbar button (CTB) to replace both the built-in Configuration and List Management buttons with one CTB - left click for Tools Configuration and right click to use this script for List Management House Cleaning. Obviously this is not a big deal, I only wanted to make access quicker for clearing or editing multiple List Management items. I initially wasn't going to bother uploading, but then I figured maybe someone else can get some use out of it.

Version 2 of ListManagementHouseCleaning.xys will now:
1) First the script will display List Management items to select for complete clearing (see screen capture - picture on left) and will then automatically clear all you've selected. This dialog list contains the typical MRU type lists that if you delete all is hell is not going to break out.
2) Next it will provide you with another dialog of List Management items (see screen capture - picture on right) from which you can select the items you which to edit one by one in succession (though you can also clear them). This dialog contains the more important List Management items like Favorite Folders or Portable File Associations.
3) Lastly, the script will ask you if you'd like to save the changes. If you elect not to, that's alright, but the changes you've made will not be saved if you exit later without saving.
Notes:
1) If you'd rather not automatically clear any List Management items in the first dialog simply click on "OK" or press "Enter" to proceed on to the next dialog to edit List Management items.
2) You see the screen flicker for a a second or two after the first dialog while the script clears the List Management items you've selected. How long it flickers depends on how many you've selected.
3) I could have done this in a 2nd instance of XY, but there are too many complications and annoyances doing that such as loosing focus of the first XY instance.
4) If you'd rather have one particular List Management item in the "Clear" list instead of the "Edit" list or visa versa, you can easily swap them in the script. The items in the two lists were my own quick personal preference. You could place all the List Management items in the second "Edit" dialog if you'd like.
ListManagementHouseCleaning.zip
(1.34 KiB) Downloaded 323 times
Version 2.1:
1) In the Clear List Management items dialog, the script will pre-check any items which have content (i.e., those that aren't void of entries).
2) In the Edit List Management items dialog, the script flag all items which have content. The flag is a big fat dot. I purposely did not pre-check the items having content as I did in the clear dialog. I didn't want to open all of these List Management item dialogs automatically unless the user checks them off simply to minimize time opening unnecessary dialogs coupled with the fact that this "Edit" dialog contains much more critical lists that the user would not want to accidentally delete or clear.
3) I also rearranged some of the List Management items between the Clear and Edit dialogs to be more in-line with whether the user would want to edit or clear the list.
Thanks highend for the pre-check suggestion.
ListManagementHouseCleaning21.JPG
ListManagementHouseCleaning21.JPG (206.22 KiB) Viewed 7434 times
I hope you can get some use out of it. Please let me know if you have any suggestions or problems.
Version 2.2:
1) It will now recognize the Sticky Section - mru items above the mru line "-----> mru" will be preserved. As it states in the help file, "Items in the Sticky Section are permanent members of this list and will never be pushed out when new items are added." The script will only delete the mru's below the mru line.
2) Took care of a couple of local references to my personal XY folder instead of using <xydata>.

As I mentioned in a previous post, I kept the 3 MRU lists, RenameSpecial, mruBatchRename, mruRegExpRename in the edit list dialog not in the auto clear list dialog. Those seem too important to wipe out (clear) if someone does not have sticky sections established.
Sorry for being ignorant on the Sticky Section of mru list when I initially wrote this (thanks hermhart). I obviously hadn't been taking advantage of the feature.
Version 2.3:
1) Added the "e" flag to formatlist to prevent any blank items in a List Management.
2) Took advantage of the new "e" flag in the foreach loops which skips or disregards any empty or blank items in the foreach list. You will need version v15.70.0118 or later.
3) Added an initial save dialog in the beginning to ensure the users settings are saved prior to continuing in List Management House Cleaning. If you don't want to see it or you save frequently anyway, you can comment it out if you'd like.
4) Recognized if the user does not have a tag.dat file in <xydata>.
5) Modified the script to recognize if the user did not make any selections in either dialog box or cancelled out of both dialogs. The script will not prompt the user to save settings at the end of the script.
6) Added the new global filters to the second dialog box (for editing).
Note: If the vertical or horizontal scroll bars appear in your dialog boxes (possibly you have a font > 9), you can increase the size of the "inputselect" box. Look for the 2 inputselect statements in the script and adjust the x,y dimensions as necessary.
Version 2.4:
1) Moved the "Visual Filters" and "Global Visual Filters" List Management items from "edit" dialog (2nd) to the "clear" dialog (1st). Since these two List Management items are now in the "clear" dialog, you should consider making sticky sections if you have any that you'd like to maintain or make Power Filters. The script will not delete any items in the sticky section.
2) In testing I noted a problem with the resultant data (filters) in List Management if/when the filter contained a "=" sign (e.g., <=, >=) in the filter - fixed.
Version 2.41:
1) Corrected situations where "Recent Locations" would not be properly processed because the script did not recognize a key in section [mrubrowse] for "Latest=".
It should be noted that changes in "Recent Locations" [mrubrowse] will not be reflected in XYplorer until a Save is accomplished and a "Save" will not be flagged as being required (i.e., the green "Save" button will not turn brown).
2) Also came across an editorial error that was causing "Files in Clipboard" not to appear in the first dialog as it should have.
Once again, please let me know if you experience any problem. Thank you for trying it out.
Version 2.5:
Updated to:
(1) Add new List Management item - Live Favorite Filters
(2) Clear history on pane 2, or I should say, the other pane
(3) Added an option for the second dialog where you can have not only the LM items with content flagged, but you can also have them prechecked as well
change the variable [$flag] in the script as follows:
set to "0" to have List Management items (with content) flagged with a "•" or
set to "1" to have LM items with content pre-checked as well.
(4) I have noticed on my computer that the items in the first LM dialog box that have an mru line would not be deleted below the mru line as they should. Those sendkeys steps involve cutting and pasting. If you have that issue, it may be due to a clipboard management program, if you use one. I use Clipjump (written in AHK). When I changed my cut and paste feature to use Win-C and Win-V instead of control-C and V, the script sendkey steps worked fine. Another option would be to temporarily disable a clipboard management program.

Thanks hermhart, Stef123, Sammay, and highend for the comments.
Thanks,
Ken

Latest version: 2.5
ListManagementHouseCleaning_v2.5.zip
(3.18 KiB) Downloaded 60 times
ListManagementHouseCleaning.zip
(1.34 KiB) Downloaded 323 times
ListManagementHouseCleaning_v2.zip
(1.5 KiB) Downloaded 239 times
ListManagementHouseCleaning_v2.1.zip
(1.99 KiB) Downloaded 235 times
ListManagementHouseCleaning_v2.2.zip
(2.4 KiB) Downloaded 249 times
ListManagementHouseCleaning_v2.3.zip
(2.55 KiB) Downloaded 235 times
ListManagementHouseCleaning_v2.4.zip
(2.55 KiB) Downloaded 218 times
ListManagementHouseCleaning_v2.41.zip
(2.55 KiB) Downloaded 409 times
Last edited by klownboy on 14 Mar 2023 17:43, edited 10 times in total.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

grindax

Re: ListManagementHouseCleaning

Post by grindax »

.
Last edited by grindax on 26 Jan 2016 16:03, edited 1 time in total.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: ListManagementHouseCleaning

Post by bdeshi »

:tup: nice little script.

btw, I can't help mentioning that there's a way to automate it completely.
This will clear current pane's history in a default english XY with default Alt+T shortcut :

Code: Select all

::sendkeys '%tly%c'; //alt+t tools, List mgmt, historY, Clear
sendkeys can send keys to other dialogs when it was opened with the same command.

:wink:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: ListManagementHouseCleaning

Post by klownboy »

Thanks Grindax and Sammay.

Sammay, nice use of sendkeys combined with the accelerator keys...cool. Though one would have to be careful setting those up to automatically clear some List Management items especially important ones like Portable File Icons of Portable File Associations that you certainly wouldn't want to clear but only edit. In testing, sendkeys works well to clear some items like your example history but fails on some others like Address Bar. Maybe due to the similar accelerator keys on some. I put in some minor states (e.g., wait "10";) and also tried using the alt key again but still a no go. Did you notice that?
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: ListManagementHouseCleaning

Post by bdeshi »

heh, since Addressbar & Goto automatically gets selected after opening the list mgmt submenu, this is the way to go: sendkeys '%tl{enter}%c';

your keysending got divided into two segments by the wait 10.... The second segment is only triggered after closing the dialog.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: ListManagementHouseCleaning

Post by Stef123 »

This could become a very comfortable front-end to dovetail with Sammay's script
http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=13704

ATM I hard-code the lists I want cleared into Sammay's script. Works great, always the same few lists that gather lint and dust on my machines. Some suspects, however, are kind of iffy, I am reluctant to hard-code them into Sammay's clearing script. So I am thinking ...... :? need more time - much more time and quiet - to study both scripts.

In any case, your script serves as a prime learning resource for creating option dialogs and reading them out to do ... whatever ... something with it.
Thanks.

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

Re: ListManagementHouseCleaning

Post by klownboy »

Stef123 wrote:This could become a very comfortable front-end to dovetail with Sammay's script viewtopic.php?f=7&t=13704
Holy macaroni, I should have done some searching before posting this. I was reluctant to post it since its intent was simply to speed up editing or clearing multiple List Management items, but I probably wouldn't have if I was aware of Sammy's script. Sorry Sammy. I suppose they are different enough though. Sammay's is meant to quickly clear MRU type List Management items and this one is essentially just to quickly access multiple items for editing or clearing. I could set it up to either automatically clear items selected or do as it does now - simply present each LM dialog box. One more question to ask the user though which goes against streamlining. And, someone could select a List Management item that shouldn't be cleared and be quite upset. Thanks Stef123.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

grindax

Re: ListManagementHouseCleaning

Post by grindax »

.
Last edited by grindax on 26 Jan 2016 16:03, edited 1 time in total.

Stef123

Re: ListManagementHouseCleaning

Post by Stef123 »

Hi Ken,
I am glad you posted this, really. Sammay's script is very different indeed, but like I said, yours looks like an ideal complement, I can't stop thinking about dove-tailing the two scripts. What I have in mind is substituting the hard-coded lists in Sammay's script with the readout of wanted lists from your script. Or grafting Sammay's script onto yours, into the positions where the cleaning should happen. Or something like that ... :ugeek: :? :whistle:
grindax wrote:]to automatically clear all those categories of items that one would want to clear when cloning XY's configuration from one PC to another, where certain lists (e.g. History, Recent Locations, Favorite Folders, etc) definitely don't contains items relevant for the transfer.
Or, if you work portable - to avoid clients peeking over your shoulder from seeing their competitors coming up in your drop downs....

However, some entries may serve as instructional examples - you would not want them cleared all the time. Ths is where Sammay's script comes in handy - it will keep all items above the MRU line.

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hey grindax and Stef123, I'll take a look at somehow melding the scripts or optionally allow the user to select those for automatic clearing. Maybe the clearing of List Management items that are more critical could have a warning come up prior to the action and those that aren't so important would be simply deleted with no prompt. A user could probably modify the script to change which ones he feels are critical.

I'm not sure how I'd approach it (i.e., I'm not sure yet if I want to pose the question in the beginning to ask the user whether they want to clear the selected LM items or edit them individually). I can't do both actions in one run or one inputselect dialog. Another idea might be to have a "ClearList Management items" display first and then an "Edit List Management items". If you only want to use one and not the other you can simply cancel out of the dialog you don't want to use. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by klownboy »

Version 2 of ListManagementHouseCleaning.xys was posted at the beginning of this thread. For a description of changes see the first post. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by highend »

Ken, a suggestion:

Check if any of the entries needs clearing (because they are have content) and (as a global option) preselect those. You'd see at first glance which items can / should be cleared...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

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

Re: ListManagementHouseCleaning

Post by klownboy »

Thanks highend, it's funny you mention that because yesterday I was thinking I'd like to do that. What I was thinking at least for the "Clear" dialog that those already empty List Management items would not be displayed at all. But maybe the better approach would be as you mention to have those that have content pre-checked. In the 2nd dialog to "Edit" List Management items, they would be flagged maybe with a BEL symbol or something since if they are empty doesn't necessarily mean the user is going to want to have them opened for editing. I hadn't gone beyond the initial thinking about it though (i.e., how to determine if each and every one of those List Management items had entries or not). In looking at it now, it looks like I could get the count number for applicable sections in XYplorer.ini. I could have the appropriate section in each listing so I could then use it in a foreach loop?

Code: Select all

getkey("Count", "FavFiles", "XYplorer.ini");
If the count is not "0", the section has entries. My biggest problem will probably be getting the proper XYplorer.ini section to the associated List Management item by name / CID.

Great idea highend. I suppose I needed that suggestion and push to actually do it. Maybe if I have time I'll work on it this weekend. Thanks and I hope all is well.

Edit: To be a bit more honest, yesterday when I was thinking along the lines of your suggestion, I thought it might be too much work and not worth the effort, but now that you brought it up and I've dug a little deeper (pardon me, I was just outside planting the my girl friend's peonies), it shouldn't be that bad.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by klownboy »

Updated the ListManagementHouseCleaning script...see the first post for changes. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

hermhart
Posts: 211
Joined: 13 Jan 2015 18:41

Re: ListManagementHouseCleaning

Post by hermhart »

Is there a way with this script to not remove any Sticky Sections from any lists, hence: "-----> mru" and above?

Post Reply