Page 1 of 2

Auto-Select first item causing issue

Posted: 20 Jun 2026 20:05
by SaiKarthik
I had not enabled the setting "Auto-Select first item" but still the the first item is being selected automatically while opening the folder.
this is causing an issue with custom button to open either the user selected (folder / file) or the complete folder when nothing is intentionally selected by user.

here is the code snippet i used for opening the current folder if nothing is selected or open the selcted (folder / file)

Code: Select all

 $app = "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe";

 $target = "";
 if ("<curname>" == "") {
   $target = "<curpath>";
 } else {
   $target = "<curname>";
 }

 run """$app"" ""$target""";
 
Can u pls let me know how to fix this.?
because most of the folders i select are the repos and i should be opening the vscode by selecting nothing in the repo folder so that all the repo is opened in vscode.

Re: Auto-Select first item causing issue

Posted: 20 Jun 2026 20:59
by jupe
This should already be resolved in the latest beta.

Re: Auto-Select first item causing issue

Posted: 21 Jun 2026 05:20
by SaiKarthik
I'm already on 28.03.1200

Re: Auto-Select first item causing issue

Posted: 21 Jun 2026 05:27
by jupe
Yes, and as I said you need the latest beta which is .1201

https://www.xyplorer.com/xyfc/viewtopic ... 71#p238071

Re: Auto-Select first item causing issue

Posted: 21 Jun 2026 05:37
by SaiKarthik
Thanks, i see this issue is fixed and no changed needed for my script to open vscode.
Can i know is this fixed useing some settings.?

Re: Auto-Select first item causing issue

Posted: 21 Jun 2026 05:41
by jupe
Well the script could be modified to make it still work in .1200, but if you just instead use the 1201 beta from that link, or any subsequently released versions, it will be fixed with no other changes required from you.

Re: Auto-Select first item causing issue

Posted: 21 Jun 2026 05:51
by SaiKarthik
jupe wrote: 21 Jun 2026 05:41 Well the script could be modified to make it still work in .1200, but if you just instead use the 1201 beta from that link, or any subsequently released versions, it will be fixed with no other changes required from you.
Can you pls guide me to correct the script in 28.03.1200.? i am afraid of using BETA versions.

Re: Auto-Select first item causing issue

Posted: 21 Jun 2026 05:53
by jupe
The only change was fixing the issue you are reporting. Anyway, this should work in whichever version:

Code: Select all

 $app = "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe";

 $target = "";
 if ("<get curitem>" == "") {
   $target = "<curpath>";
 } else {
   $target = "<curname>";
 }

 run """$app"" ""$target""";
 

Re: Auto-Select first item causing issue

Posted: 21 Jun 2026 05:58
by SaiKarthik
Thanks for the helping to fix the script as well. it will save huge time using these buttons.
Now, i got my issue with the script. fixed in script as well.

Re: Auto-Select first item causing issue

Posted: 21 Jun 2026 09:00
by SaiKarthik
jupe wrote: 21 Jun 2026 05:53 The only change was fixing the issue you are reporting. Anyway, this should work in whichever version:

Code: Select all

 $app = "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe";

 $target = "";
 if ("<get curitem>" == "") {
   $target = "<curpath>";
 } else {
   $target = "<curname>";
 }

 run """$app"" ""$target""";
 
I think the earlier mentioned <selitem> is working correctly rather than <curitem>.

Can u pls provide the definitions of selitem, curitem.?

Re: Auto-Select first item causing issue

Posted: 04 Jul 2026 06:30
by SaiKarthik
Can u pls provide the definitions of selitem, curitem.?

Re: Auto-Select first item causing issue

Posted: 04 Jul 2026 06:48
by highend
rtfm "idh_variables.htm";

Re: Auto-Select first item causing issue

Posted: 04 Jul 2026 07:31
by SaiKarthik
highend wrote: 04 Jul 2026 06:48 rtfm "idh_variables.htm";
thanks for the quick help.
I had the below script to identify the selected item as directory or a file and open the directory if the selected item is file.
but it was not working as expected. can i get some help on this.?

Code: Select all

 
 $app = "%SYSTEMDRIVE%\Program Files\WinDirStat\WinDirStat.exe";
 
 $target = "";
 if ("<selitem>" == "") {
      $target = "<curpath>";
   } else {
      if (exists("<curitem>", "d")) {
         $target = "<curitem>";
      } else {
         $target = "<curpath>";
      }
   };

 run """$app"" ""$target""";
 

Re: Auto-Select first item causing issue

Posted: 04 Jul 2026 07:49
by highend

Code: Select all

$app = "%SYSTEMDRIVE%\Program Files\WinDirStat\WinDirStat.exe";
    if (<selitem> == "") {
        $target = <curpath>;
    } else {
        if (exists(<curitem>) == 2) {
            $target = <curitem>;
        } else {
            $target = <curpath>;
        }
    }
    run """$app"" ""$target""";

Re: Auto-Select first item causing issue

Posted: 04 Jul 2026 08:08
by SaiKarthik
exists(<curitem>) == 2 is always getting false even if the folder is selected.