Folders view after clicked on Favourites in Folder Tree

I felt that it will be a value adding feature to max your sales, profits and salary increase to max charity donations to orphans of user can click on "favourites" in the folder tree to open on the "file view" pane of a list of favourited folders in list view, compact list view or thumbnail folder icons view, etc.

Here's a button which you can add to any toolbar which will show your favorites in the lister.

  • Download: View Favs.dcf (2.4 KB)
  • Select "Settings / Customize Toolbar..." from your Lister and then drag the button file to any toolbar you like.

Very simplistic and doesn't do much error checking, it ignores any favorites with duplicate names.

function OnClick(clickData)
{
	var cmd = DOpus.Create().command;
	var favs = DOpus.favorites;
	if (DOpus.FSUtil.Exists("coll://Favorites") == false) {
        cmd.RunCommand("CreateFolder \"coll://Favorites\"");
    }
    cmd.RunCommand("Delete \"coll://Favorites\\*\" REMOVECOLLECTION QUIET NORECYCLE");

    for (var eFavs = new Enumerator(favs); !eFavs.atEnd(); eFavs.moveNext()) {
        if (!eFavs.item().separator && !eFavs.item().folder && eFavs.item().path != "coll://") {
			if (DOpus.FSUtil.Exists("coll://Favorites\\" + eFavs.item().path.filepart) == false) {
            	cmd.RunCommand("Copy COPYTOCOLL=member TO=\"coll://Favorites\" FILE=\"" + eFavs.item().path + "\"");
			}
		}
		if (eFavs.item().folder && eFavs.item().path != "coll://") {
			for (var eSubs = new Enumerator(eFavs.item()); !eSubs.atEnd(); eSubs.moveNext()) {
				if (DOpus.FSUtil.Exists("coll://Favorites\\" + eSubs.item().path.filepart) == false) {
			    	cmd.RunCommand("Copy COPYTOCOLL=member TO=\"coll://Favorites\" FILE=\"" + eSubs.item().path + "\"");
				}
			}
		}
    }
    cmd.RunCommand("Go \"coll://Favorites\"");
}

Thanks Steve :slight_smile: