User Button Not Working as Expected

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
phred
Posts: 668
Joined: 26 Dec 2021 02:10
Location: XY 64bit on Win10 at 100% from Boston USA

User Button Not Working as Expected

Post by phred »

Using XY 28.30.1600 on Win10 desktop.

I created a user button to toggle Read Only on or off. I select all the files in the list, click the button and only one file changes. I expected all selected files to change. This is the code I'm using. What do I need to change in order for it to work on all selected files?
attrstamp("r", 3, quicksearch("/f", <curitem>));

highend
Posts: 14983
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: User Button Not Working as Expected

Post by highend »

If you've selected the files: attrstamp("r", 3);?
One of my scripts helped you out? Please donate via Paypal

phred
Posts: 668
Joined: 26 Dec 2021 02:10
Location: XY 64bit on Win10 at 100% from Boston USA

Re: User Button Not Working as Expected

Post by phred »

Okay, this is now getting a little weird.

I tried your suggestion and it didn't change anything. Not with the entire list selected nor with one file selected. I went back to what I had originally and the attribute did not change with one or all files selected.

highend
Posts: 14983
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: User Button Not Working as Expected

Post by highend »

Animation.gif
To see the attached files, you need to log into the forum.
One of my scripts helped you out? Please donate via Paypal

phred
Posts: 668
Joined: 26 Dec 2021 02:10
Location: XY 64bit on Win10 at 100% from Boston USA

Re: User Button Not Working as Expected

Post by phred »

Yes, I see that it works for you, but not for me.
2026-08-03_10-40-22.jpg
2026-08-03_10-40-44.jpg
To see the attached files, you need to log into the forum.

highend
Posts: 14983
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: User Button Not Working as Expected

Post by highend »

No clue what you want to say with these pictures...

Select one file, execute the script (from Scripting - Run Script...)
Post the result

Code: Select all

    $log    = <curitem> . <crlf>;
    $result = attrstamp("r", 3, <curitem>);
    $log   .= "Attributes before: " . $result . <crlf>;
    $result = attrstamp("r", 3, <curitem>);
    $log   .= "Attributes after: " . $result;
    text $log;
One of my scripts helped you out? Please donate via Paypal

phred
Posts: 668
Joined: 26 Dec 2021 02:10
Location: XY 64bit on Win10 at 100% from Boston USA

Re: User Button Not Working as Expected

Post by phred »

The screenshots were my attempt to show you that the modified code you listed
attrstamp("r", 3);
didn't work.

One file selected, your script executed from Run Script. No attributes changed despite what this shows. 13 files in the directory; 2 are HS-A and 11 are R-A. Before and
Z:\Pending Audio\Chicago - Chicago Carnegie Hall Apr 5-10, 1971\CD3\04. Anxiety's Moment.mp3 Attributes before: 33 Attributes after: 32

highend
Posts: 14983
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: User Button Not Working as Expected

Post by highend »

It obviously did work (at least that's what attrstamp says)
That file had the attribute +R before the script was executed
Then the script set it -R and again to +R
One of my scripts helped you out? Please donate via Paypal

phred
Posts: 668
Joined: 26 Dec 2021 02:10
Location: XY 64bit on Win10 at 100% from Boston USA

Re: User Button Not Working as Expected

Post by phred »

Then might there be an issue with the attributes in the list not updating? Because that's what I'm basing my "it doesn't work" on.
The files show RA attributes. Before and after executing it.

EDIT: I found the problem. XY is not updating/refreshing the list after the script has run. I have view > auto-refresh enabled but it isn't auto-refreshing. Hitting F5 refreshes the list and updates the attribute.

I rolled back to 28.30.0702 and the issue is present. I toggles auto-refresh off and then on and XY is not refreshing the attributes. Looks like Don will have something to do when he returns. Do you think I should post this in the Bugs section?

Thanks, highend for helping me figure out what was going on.

Post Reply