Page 1 of 1

exist() doesn't work properly anymore?

Posted: 05 Feb 2019 19:27
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:

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

Posted: 05 Feb 2019 20:07
by admin
Good point, that behavior was indeed changed. Did not intend to. Will change it back.