Page 1 of 1

MiniTree commands seem to trigger CEA "Changing Locations"

Posted: 12 Oct 2021 00:10
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.

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

Posted: 12 Oct 2021 01:05
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; }

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

Posted: 13 Oct 2021 00:46
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.

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

Posted: 13 Oct 2021 01:42
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.

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

Posted: 13 Oct 2021 02:38
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.

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

Posted: 16 Oct 2021 02:46
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

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

Posted: 23 Oct 2021 02:06
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.

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

Posted: 23 Oct 2021 11:50
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;

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

Posted: 23 Oct 2021 15:36
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!