exist() doesn't work properly anymore?

Things you’d like to miss in the future...
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: 60566
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @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