exist() doesn't work properly anymore?
Posted: 05 Feb 2019 19:27
As of 19.60 update, this little script doesn't work properly anymore.
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:
If I run this script when nothing is selected:
it works fine and opens current path in Windows Explorer.
But if I only change it to 2 (for selected folder) like this:
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.
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>""";
}
It seems to have something to do with this particular part:
Code: Select all
if (exists("<curitem>") == 2)Code: Select all
$explorer = "%windir%\explorer.exe";
if (exists("<curitem>") == 1) {
run """$explorer"" ""<curitem>""";
} else { // No selection
run """$explorer"" ""<curpath>""";
}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>""";
}In 19.50 it works OK.
If it's not a bug, I apologize for disturbance and false accusations.