ListManagementHouseCleaning

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hey Stef123, no rush. I'm in no rush to issue the change really. All it does is ask to save up-front, adds the 'e' parameter to one formatlist line to help in preventing a blank line, and it will eliminates the save question at the end if the user cancels out of the two dialogs. So no big deal and no rush. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Stef123

Re: ListManagementHouseCleaning

Post by Stef123 »

Seems OK most of the time, Ken,
on my own machines it works fine if I first save XY settings before running the script. However, it will add the current/ last used search term in FindFiles: Name to the top of the mru sticky section. It was not in the sticky section before running the script.

With some ini-configs, it triggers a scripting error at line 46:

Code: Select all

elseif(($list_name == "Tagged Items") AND !(gettoken(readfile("<xydata>\tag.dat", "t", , ,"1"), gettokenindex("*Data:", readfile("<xydata>\tag.dat", "t", , ,"1"), "<crlf>", "iw")+1, "<crlf>", ,"2"))) {
Says it cannot find the file tag.dat. Clicking "continue" does not help, it remains stuck on this line and error. Was able to reproduce it with a fresh; instance. 15.70.0100

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hi Stef123, Well it appears to be a missing tag.dat this time. Hopefully I resolved the servers.dat issue. I didn't have a check for the existence of tag.dat because even a fresh provides or installs 'tag.dat'. I have a tag.dat in my fresh folder as well as in my normal <xydata> folder and I have NO tags. Do you not have tag.dat in the <xydata> folder or in the fresh folder? I'm not sure where a run in fresh looks when it sees the XY variable <xydata> (i.e., if it's looking in the fresh folder or in the normal installed/portable folder<xydata>) and this script really isn't the type of script to be run on fresh. The script looks in <xydata>. I can put in a check, but I'd rather not if you've changed or don't have a typical install even portable install. I was under the impression XY will have a tag.dat (as I do) even if the user doesn't have any tags assigned. :eh: :o

Missed the other comment. I'll look at the comment concerning the last used mru item being at the top of the sticky section. I will try to reproduce. I know it gets rid of dupes. It could be the order in which it works...getting rid of dupes and getting rid of items below the mru line. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Stef123

Re: ListManagementHouseCleaning

Post by Stef123 »

klownboy wrote: I didn't have a check for the existence of tag.dat because even a fresh provides or installs 'tag.dat'. I have a tag.dat in my fresh folder as well as in my normal <xydata> folder and I have NO tags. Do you not have tag.dat in the <xydata> folder or in the fresh folder?
Whoa - that's interesting, really. Never given it much thought, all I do is this:
1) I open the AB, or rather GoTo dialog
2) I type fresh; ENTER

XY then opens another instance that looks fresh, actually even pristine, to me. When I use another file manager to check the folder structure of my (still open) XY location, I get to see \Data\Fresh with various subfolders - but none of them contains tag.dat.

ED:
My original data folder, however, does contain tag.dat. Don't know if XY is supposed to transfer it over to \fresh, in any case, it does not seem to do it.

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

Re: ListManagementHouseCleaning

Post by klownboy »

Stef123 wrote:XY then opens another instance that looks fresh, actually even pristine, to me. When I use another file manager to check the folder structure of my (still open) XY location, I get to see \Data\Fresh with various subfolders - but none of them contains tag.dat.
So who knows what governs whether tag.dat gets installed or not? My <xydata> folder is the XYplorer folder I have no separate data folder (that is different, but it's been that way for over 3 years- so <xydata> is my XYplorer folder). Under XYplorer I have a Fresh and it has a tag.dat and there's is another tag.dat in XYplorer folder. As I mentioned I don't really trust this script running in fresh since who knows where it looks for data and there really shouldn't be any data in a fresh (that's why we had to supply it). If you run it in a normal installation it should have found the tag.dat in <xydata> though. :?

On the last used on the top issue. Yes that is definitely an issue. I reproduced it. The last used item ends up as "Named0=XXX" in XYplorer.ini and is course repeated in the list which may or may not be in the sticky section. I may have to take a different approach. Get rid of the count line and Named0= line since Named0 will always be repeated whether it's in the sticky section or in the normal items below the sticky.
Thanks
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Stef123

Re: ListManagementHouseCleaning

Post by Stef123 »

klownboy wrote: As I mentioned I don't really trust this script running in fresh since who knows where it looks for data ...
Yes, I agree, no need to worry about fresh. The only reason I used it in the first place was to rule out any quirks in my polluted ini. Very strange, though, that your fresh produces a tag.dat and mine does not. Spoils the whole idea of fresh imo, which should allow comparisons between different users and machines. I'd expect it to be the same everywhere.

Anyway, if it's not too much hassle, maybe you could simply make the script skip the error if it cannot find a tag,dat. If not, don't worry about it. Should I run into trouble with real life ini- configs, I will try to track it down further, and then we can take it from there.

Thanks for coming up with yet another maintenance script, Ken. These maintenance features are lacking in XY and your scripts make up for it :tup:

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hi Stef123, yes I'll check for the existence of tag.dat like I did earlier for server.dat. Hopefully you don't get that server.dat error anymore? I deleted the contents of my fresh folder and now when I run fresh I have no tag.dat. So maybe it depends on what you do after fresh is run. The tag.dat file was only a few days old but something I did when I ran fresh must have generated a tag.dat. :eh:

I fixed the other problem you mentioned with last mru showing at the top of the list. I was using 'dedupe' parameter but forgetting that dedupe requires the list be sorted first so that the identical items are adjacent in the list and I wouldn't want to sort this list. Sometimes they may be adjacent and sometimes they won't. So instead I'll simply remove the '0' list item (which corresponds to the highlighted item visible in the text box) like "Named0=xxx" or "LookIn0=xxx" since it will always be repeated in the list whether it's in the sticky section or not. It seems to be working fine going that route.

Thanks for the comments.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

ripu
Posts: 5
Joined: 29 Aug 2014 14:00

Re: ListManagementHouseCleaning

Post by ripu »

Hi, I was looking for something like this for months. Thanks for sharing it. :tup:

Is there any way to select all the items on the 1st list by default without checking if they are empty? :?:

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hi ripu, thanks for the comments. I'd have to change the script to do that as a default. If the LM items aren't checked they have no content anyway so I'm not sure why you'd want to do that (i.e., empty list that are already empty). I'm not sure it would be worthwhile to modify the script. It would have been much easier to write the script initially if I didn't have to check each LM item for content. :) However, if you right click in the dialog box and select check all or hit the "a" key. You can also "Unselect all" from that right click menu.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hi Stef123, I have a preliminary of version 2.3 ready. I was wondering if you'd give it a spin to check for some of the issues you experienced. It seems to be working fine for me. I also put it the save dialog up front and eliminated the save at the end dialog at the end if the user cancels out or makes no selections in both dialogs. Certainly no rush. I'll PM you the updated script. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Stef123

Re: ListManagementHouseCleaning

Post by Stef123 »

Hi Ken,
thanks for the preview, ahead of the official release.
This looks very promising, in fact, GREAT. Both issues are gone, now it works flawless, at least from what I can tell so far, from testing it on my home machine. :tup: :tup:

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

Re: ListManagementHouseCleaning

Post by klownboy »

Thanks a whole bunch Stef23 for checking it out. I'll run some more test myself. Hopefully I'll post it within a day or two.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by hermhart »

Hi klownboy,

Are you still planning on posting your updated script? I really like this script a lot.

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hi hermhart, yes I do have another version ready. I was dragging my feet to upload. I just noticed Don posted a new beta which affects 'foreach' loops - it will disregard empty items in the list so I incorporated that. So you will need beta v15.70.0118 to test. I'll PM you a copy of v2.3 so you can check it out after upgrading to v15.70.0118. Let me know if you have any issues.
Thanks again.
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by klownboy »

Posted version 2.3. Please refer to the first post to see what has changed. If you give it a try, please let me know if you experience any issues. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Post Reply