admin wrote:Stefan wrote:Basic script would be f.ex. like:
Code: Select all
$ITEM = "<curname>";
$OtherPane = get("path", i);
if (exists("$OtherPane\$ITEM")==1)
{
echo "Yes, file $ITEM exist on other pane too.";
//do more actions here
}
elseif(exists("$OtherPane\$ITEM")==2)
{
msg "$ITEM exists as folder.";
//do more actions here
}
else
{
msg "$ITEM not found on other Pane";
//do more actions here
}
Again categories are being mixed.

The function exists() does not tell whether an item exists on a pane (but in the file system). If the pane is e.g. visually filtered it does not "exist" on that pane.
Ahh,
thanks for that explanation, i never thought about this
Maybe this should be reflected in the help:
exists()
Checks whether a file or directory exists on the file system (Must not be visible on an pane).
Name: listpane
Action: Lists the visible contents of a (even filtered) pane.
Now i understood why listpane() was introduced
Code: Select all
$ITEM = "<curname>";
$Result = listpane(i, $ITEM, 5); //check for file
if ($Result == "")
{
$Result = listpane(i, $ITEM, 6); //check for folder
if ($Result == "")
{
msg "$ITEM not found on other Pane";
}
else
{
msg "$ITEM exists as folder.";
}
}
else
{
msg "Yes, file $ITEM exist on other pane too.";
}