MiniTree commands seem to trigger CEA "Changing Locations"

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

: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: 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: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
autocart
Posts: 1388
Joined: 26 Sep 2013 15:22

MiniTree commands seem to trigger CEA "Changing Locations"

Post by autocart »

Hi Don,

MiniTree altering commands, even if they do NOT change the location, seem to trigger CEA "Changing Locations", at least "After painting the file list".
I made a CEA script containing the lines:

#511;
loadtree "<newpath>|" . listfolder(<newpath>, , 2), 1;

Then the warning comes that the script seems to be recursive.
I finally made it work like this:

Code: Select all

//miniT_expand_loc
 setting "AllowRecursion";
 perm $miniT_expand_loc_i;
 if ($miniT_expand_loc_i == "") {$miniT_expand_loc_i = 0;}
 if ($miniT_expand_loc_i == 0) {
  $miniT_expand_loc_i++;
  #511;
  loadtree "<newpath>|" . listfolder(<newpath>, , 2), 1;
  $miniT_expand_loc_i = 0;
 }
 
However, it is not intuitive that a MiniTree altering command that does NOT change the location would trigger a "Changing Locations" event.

Thx for reading. Regards, S.
Last edited by autocart on 12 Oct 2021 01:12, edited 1 time in total.

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

Re: MiniTree commands seem to trigger CEA "Changing Locations"

Post by highend »

If I use that line for that event text "changed";

and run my script to add the current selected folder(s) to the mini-tree, the event isn't fired...

Code: Select all

    if (<get CountSelected> == 0) { status "At least a single folder must be selected, aborted!", "8B4513", "stop"; end true; }

    $paths = "";
    foreach($item, <get SelectedItemsPathNames>, <crlf>, "e") {
        if (exists($item) == 2) { $paths .= $item . <crlf>; }
    }
    if ($paths) { loadtree $paths, 1; }
One of my scripts helped you out? Please donate via Paypal

autocart
Posts: 1388
Joined: 26 Sep 2013 15:22

Re: MiniTree commands seem to trigger CEA "Changing Locations"

Post by autocart »

This becomes more and more confusing to me.

The command #511 actually does NOT trigger a change location event if called through the toolbar button context menu.
It also does NOT trigger a change location event if called as scripted command in the address bar like ::#511;
However, if I add it as scripted command to the CEA "After painting the file list", then it DOES seem to trigger all three change location events.

EDIT:
The same is true of loadtree. If called from the AB, it does not trigger CEA location change. But if called from within the CEA location change, then the script stack all of a sudden seems to be recursive to XY.
Tried it also with a fresh instance.
Last edited by autocart on 23 Oct 2021 02:45, edited 3 times in total.

klownboy
Posts: 4468
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: MiniTree commands seem to trigger CEA "Changing Locations"

Post by klownboy »

Could the setting SkipBrowseEvents be affecting your issue? Tweak("SkipBrowseEvents", '0'); will "on the fly" enable ('0') all Change Location CEAs or disable them ('1') viewtopic.php?p=120052#p120052. I had used the tweak myself to enable / disable Change Locations CEA in some scripts and later and forgot I had set it and of course it affected many other things.

autocart
Posts: 1388
Joined: 26 Sep 2013 15:22

Re: MiniTree commands seem to trigger CEA "Changing Locations"

Post by autocart »

klownboy wrote: 13 Oct 2021 01:42 Could the setting SkipBrowseEvents be affecting your issue? Tweak("SkipBrowseEvents", '0'); will "on the fly" enable ('0') all Change Location CEAs or disable them ('1') viewtopic.php?p=120052#p120052. I had used the tweak myself to enable / disable Change Locations CEA in some scripts and later and forgot I had set it and of course it affected many other things.
Interesting tweak but I never even knew that it exited. I never used it.
Thank you for the hint, though. For sure I could use it to make things a bit easier.

autocart
Posts: 1388
Joined: 26 Sep 2013 15:22

Re: MiniTree commands seem to trigger CEA "Changing Locations"

Post by autocart »

Just if anyone is interested in it, I updated/improved the inital script and like it a lot so far.

I now shared the code in the Script Exchange forum: viewtopic.php?f=7&t=23621

autocart
Posts: 1388
Joined: 26 Sep 2013 15:22

Re: MiniTree commands seem to trigger CEA "Changing Locations"

Post by autocart »

autocart wrote: 13 Oct 2021 00:46 This becomes more and more confusing to me.

The command #511 actually does NOT trigger a change location event if called through the toolbar button context menu.
It also does NOT trigger a change location event if called as scripted command in the address bar like ::#511;
However, if I add it as scripted command to the CEA "After painting the file list", then it DOES seem to trigger all three change location events.

EDIT:
The same is true of loadtree. If called from the AB, it does not trigger CEA location change. But if called from within the CEA location change, then the script stack all of a sudden seems to be recursive to XY.
Tried it also with a fresh instance.
Don, could you have another look at this, please.

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

Re: MiniTree commands seem to trigger CEA "Changing Locations"

Post by admin »

The next version should handle that better.

You might want to use this line then:

Code: Select all

loadtree "<newpathspecial>|" . listfolder(<newpathspecial>, , 2+64), 1;

autocart
Posts: 1388
Joined: 26 Sep 2013 15:22

Re: MiniTree commands seem to trigger CEA "Changing Locations"

Post by autocart »

Thank you!
loadtree and #511 do not make the script recursive anymore when called from the "After painting the file list" Location Change CEA.
I did not check the other loc change CEAs, but looking good so far.

Regarding the special folder thing, even though I did not ask for it, that was still also a desparately needed improvement.
Thank you!

Post Reply