ListManagementHouseCleaning

Discuss and share scripts and script files...
bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: ListManagementHouseCleaning

Post by bdeshi »

Hold the press!

Needed to save settings after adding a mru line there. It's all right now. Perhaps it should also ask to save settings beforehand to work with most current lists (and match user-expectation).

However there's another tiny issue: a blank line at the top is added.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: ListManagementHouseCleaning

Post by Stef123 »

klownboy wrote: You do have a space between the right arrow and mru?
Yes. If not, I wouldn't be seeing the differently colored sticky items in my dropdowns, but would see some invalid -->rmu line instead. Because I do see the colored sticky section, however, I am positive my -----> mru line has the correct syntax.
klownboy wrote: If you get a chance, could you try changing line 105 to read $mrutext = "mru";
Makes no difference. It still trashes the whole thing.

What happens when you run your script on a fresh; instance of XY - after first setting up a few sticky items, of course - does it work on your end?

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hi Stef123, I'm not sure about your case but when I use a fresh instance, the list management item for Find Files: Name is blank. It doesn't use the 'normal' instances lists. That's probably what you meant about making a new list. So I had to place them in the fresh list management, Find Files: Name first before I could test. I did that though, and it tested fine deleting only those items after the mru line. Anything odd or different you can think of on your setup. I know you said earlier in the thread you had no server.dat. Anything else that might be considered unusual?

Hi Sammy thanks for testing. Yes, I probably should remind users to save any list management items (save settings) before using especially since some people may be adding stuff to lists just for testing. :) I wondered what was going on a couple of times myself when testing and then I remembered I hadn't saved after changing the list(s) before running the script. Hermhart also reported the blank line at the top of the list. I haven't had a chance to check it out yet. I don't know why it doesn't happen to my list. It's odd that that would be a system thing. Thanks.

Edit: I hadn't noticed your previous post. Thanks yes definitely, canceling out of each dialog should be flagged and if both flags are detected not give the save dialog. Hopefully, on the next update.
Concerning Windows 10 Pro, it's running fine on one computer but I did have to change how some scripts with special symbols like the "007" bell were saved (ANSI wasn't working) for them to appear correctly (i.e., not the darn rectangles). I still haven't jumped through hoops yet doing the upgrade from 7 to 8 Pro, performing 163 updates (if it lets me this time), updating to 8.1, and then update to 10 Pro...it makes my head spin thinking about the time that's going to waste. :roll: Getting to the pro version on this computer may not be worth it.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by klownboy »

Sammay or hermhart, could you do me a favor and try a change to the script to see if we can remove the empty line you are getting. I don't get the empty line so it's hard for me to tell what's happening and why it's happening. In line 104 add an 'e' to the formatlist flags as so:

Code: Select all

$list = formatlist($list, "tfe", "<crlf>","!Count*");
If that doesn't work, remove that 'e', and add an 'e' to the flags in a subsequent 'formatlist' statement in line 117 to see if it strips out the blank line on the top of the list like this:

Code: Select all

$new_list = formatlist($new_list, "tude", "<crlf>");
You could temporarily add a text $list; and text $new_list; after the statements to see if the blank line is there. Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by highend »

Count*
Does that contain a <crlf> separated list?
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 »

highend wrote:Does that contain a <crlf> separated list?
Hi highend, yes it is a "<crlf>" separated list. The idea being to simply strip out the first line of the SC getsectionlist output which for these cases is, "Count=xx". It works for me and I think it's working for the others who have tried it, but some people are getting a blank line in the resultant MRU list (which strips out the MRUs which are not sticky). The second use of SC formatlist a bit later in the script (in my post above) should remove any blank lines. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by highend »

I've never used your script so I'm not the one to debug it :)

Can you show me some quoted examples of what people are getting and why that breaks <something>. Maybe we'll find a more reliable way to red rid of this bug (if it's one)...
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 »

Hi highend, since I'm not getting a resultant MRU listing that has a blank first line, I can't tell you much more than that. So I assume it would look like this if viewed in edit mode of the List Management item like "Find Files: Name" with a blank line on top.

Code: Select all


* /ed  //find all empty folders
* /ef  //find all empty files
* *  //Find files and folders with spaces
-----> mru
I was thinking it could also be a 'sendkeys' issue causing the blank line for some reason. It should simply enter the list management, go into edit mode send control a to select all and then paste what is already in the clipboard. We'll wait first to see what Sammay or hermhart finds out if they try what I asked above. Thanks highend.
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 »

Well, retried this morning and now the blankline's gone. I'd deleted that line from xyini beforehand.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: ListManagementHouseCleaning

Post by Stef123 »

klownboy wrote:Hi Stef123, I'm not sure about your case but when I use a fresh instance, the list management item for Find Files: Name is blank. It doesn't use the 'normal' instances lists. That's probably what you meant about making a new list.
Yes exactly, that's why I added some entries including -----> mru.
What Sammay said about saving , not just after the act but also up front when the script starts, makes sense to me considering that your script searches the ini (as opposed to the SendKeys approach). How else would the ini reflect the current state of affairs?

I wonder why it's always me running aground problems. Guess my ini must be in bad shape. Maybe I should use other ini-files when testing out scripts and betas and perm variables and what not.

However, fresh; also triggers scripting errors - will try it on different machines today and in real life clients' scenarios.

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

Re: ListManagementHouseCleaning

Post by hermhart »

klownboy,

Your second suggestion worked for me. That being:

Code: Select all

$new_list = formatlist($new_list, "tude", "<crlf>");
This script works like a charm.

Thank you!

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hi Sammay, glad you've gotten rid of the blank line. I'd make that second change I recommended above anyway (i.e., adding an 'e' parameter to SC formatlist to strip out any blanks $new_list = formatlist($new_list, "tude", "<crlf>"); ) especially since it worked for hermhart. I'll put that in the next change.

Code: Select all

$new_list = formatlist($new_list, "tude", "<crlf>");
Hi Stef123 (and Sammay), I'll add a dialog up front to save XY settings. I typically don't change theses things too often so I didn't bother. As you said, I think it's worth while in this case though. Hey, it's only one more dialog box we'll have to click through. As Sammay suggested, I'll also remove the last save dialog if the user canceled out of both previous dialogs. Stef123 let me know if you have any luck or not on another setup.
Hi hermhart , glad it's working alright now.
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by klownboy »

Concerning a save settings up-front dialog, wouldn't it be nice if we had a way to detect that settings were saved? Not just for this script but many others. We wouldn't have to bother asking the question at all if we could get the save status and settings were saved. I'm only talking in a general sense. We wouldn't need to know the status of specific setting and whether they are saved, but simply a flag which would be "1" or "0" - the same flag that changes the CTB button from green to brown or visa versa (e.g., get 'savesetting'). I think I brought that up once before but got little support. Well here's the need again. :biggrin:
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

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

Re: ListManagementHouseCleaning

Post by klownboy »

Hey Stef123, any luck in finding out what might be causing the issue you have (i.e., the script wiping out the MRUs including the sticky section)? Maybe it would help if you looked directly at the [Named] section in XYplorer.ini (on the computer you reported the issue) to see if has the standard format which should be like this...

Code: Select all

[Named]
Count=4
Named0="* /ed  //find all empty folders"
Named1="* /ed  //find all empty folders"
Named2="* /ef  //find all empty files"
Named3="* *  //Find files and folders with spaces"
Named4="-----> mru"
I ask because I have the other changes discussed ready to go and of course I'm curious what the problem might be and I'd like to fix it if possible. Thanks.
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Stef123

Re: ListManagementHouseCleaning

Post by Stef123 »

Hi Ken,
thanks for asking, things look much better when I first save, then run your script. Still baffled by some errors that don't come up with certain ini configs, but for some strange reason are triggered when running fresh;

Please go ahead anyway, will report back asap, hopefully by tomorrow.
Thanks
Stef

Post Reply