exist() doesn't work properly anymore?

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

: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: Use Your Profile Or Signature
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: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
Lexus
Posts: 4
Joined: 05 Feb 2019 18:08

exist() doesn't work properly anymore?

Post by Lexus »

As of 19.60 update, this little script doesn't work properly anymore.

Code: Select all

$explorer = "%windir%\explorer.exe";
    if (exists("<curitem>") == 1) { // Selected file
        run """$explorer"" /select,""<curitem>""";
    } elseif (exists("<curitem>") == 2) { // Selected folder
        run """$explorer"" ""<curitem>""";
    } else { // No selection
        run """$explorer"" ""<curpath>""";
    }
When there is no selection (the "else" part should be executed) - it doesn't open current path anymore - just default explorer location. In previsous versions it opens the current path.


It seems to have something to do with this particular part:

Code: Select all

if (exists("<curitem>") == 2)
If I run this script when nothing is selected:

Code: Select all

$explorer = "%windir%\explorer.exe";
    if (exists("<curitem>") == 1) { 
        run """$explorer"" ""<curitem>""";
    } else { // No selection
        run """$explorer"" ""<curpath>""";
    }
it works fine and opens current path in Windows Explorer.

But if I only change it to 2 (for selected folder) like this:

Code: Select all

$explorer = "%windir%\explorer.exe";
    if (exists("<curitem>") == 2) { 
        run """$explorer"" ""<curitem>""";
    } else { // No selection
        run """$explorer"" ""<curpath>""";
    }
Now it doesn't work anymore and always opens "This PC" instead of current path.

In 19.50 it works OK.

If it's not a bug, I apologize for disturbance and false accusations. :biggrin:

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

Re: exist() doesn't work properly anymore?

Post by admin »

Good point, that behavior was indeed changed. Did not intend to. Will change it back.

Post Reply