Auto-Select first item causing issue

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:
SaiKarthik
Posts: 34
Joined: 05 Aug 2023 17:32

Auto-Select first item causing issue

Post 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.

jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Auto-Select first item causing issue

Post by jupe »

This should already be resolved in the latest beta.

SaiKarthik
Posts: 34
Joined: 05 Aug 2023 17:32

Re: Auto-Select first item causing issue

Post by SaiKarthik »

I'm already on 28.03.1200

jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Auto-Select first item causing issue

Post by jupe »

Yes, and as I said you need the latest beta which is .1201

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

SaiKarthik
Posts: 34
Joined: 05 Aug 2023 17:32

Re: Auto-Select first item causing issue

Post 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.?

jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Auto-Select first item causing issue

Post 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.

SaiKarthik
Posts: 34
Joined: 05 Aug 2023 17:32

Re: Auto-Select first item causing issue

Post 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.

jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Auto-Select first item causing issue

Post 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""";
 

SaiKarthik
Posts: 34
Joined: 05 Aug 2023 17:32

Re: Auto-Select first item causing issue

Post 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.

SaiKarthik
Posts: 34
Joined: 05 Aug 2023 17:32

Re: Auto-Select first item causing issue

Post 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.?

SaiKarthik
Posts: 34
Joined: 05 Aug 2023 17:32

Re: Auto-Select first item causing issue

Post by SaiKarthik »

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

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

Re: Auto-Select first item causing issue

Post by highend »

rtfm "idh_variables.htm";
One of my scripts helped you out? Please donate via Paypal

SaiKarthik
Posts: 34
Joined: 05 Aug 2023 17:32

Re: Auto-Select first item causing issue

Post 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""";
 

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

Re: Auto-Select first item causing issue

Post 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""";
One of my scripts helped you out? Please donate via Paypal

SaiKarthik
Posts: 34
Joined: 05 Aug 2023 17:32

Re: Auto-Select first item causing issue

Post by SaiKarthik »

exists(<curitem>) == 2 is always getting false even if the folder is selected.

Post Reply