I'm using jscript. I corrected the first issue (ie Desktop), but now the root drive displays as "C:" without the slash. I prefer the slash, which is why I set it up as "%R\" in the first place. I'm stuck, unless you have a suggestion for this.
Actually components returns 0 for This PC. I'm not sure why you can't make that work. Fundamentally it's you who's adding the backslash, all you need to do is work out when not to add it and not add it.
Path.components seems to return 2 for This PC (/mycomputer) when run against a lister, I think due to it having to ':' in the special kind of path that designates that kind of folder.
Thank you both for the input. It appears DOpus sees both C: and My PC as root drives, and I only want the slash after C:, not after My PC or any other system/DOpus alias. While I'm sure there's a way to differentiate between the two, I don't know it.
var id = tab.path;
if (tab.path.root == false) //Check if at root drive
{
if (id.substr(id.length - 1) == ":")
{
title = title + " | FOLDER: %R";
} else
{
title = title + " | FOLDER: %R\\";
}
} else
{
title = title + " | FOLDER: %R\\...\\%N";
}
Output defaults to last else statement ("%R\...%N") in every case.