The main task for the script would be to make a smart dropdown button from a folders content. With files, Xyplorer should open them, with folders Xyplorer should open them in a new tab.
Maybe a more experienced user can have a look at the script, correct some mistakes and make it better, right now it just open files.
The script so far:
Code: Select all
$DISASTER_MSG = "You don't have at least one file!<crlf><crlf>Quiting now.";
$DIR_FILES = "<xypath>\_GAMES";
// Gather menu entries
$Files = "";
//Layout section: Prepare list from files names of saved layouts
If (Exists($DIR_FILES) == 2) {
//$Files = ListFolder($DIR_FILES, "*.*", 5);
$Files = FormatList(FolderReport("files","r",$DIR_FILES\,"r",,"|"),f,"|","*.*");
$Files = Replace($Files, "$DIR_FILES\", "");
$Files = Replace($Files, "*.*", "");
}
// Exit if nothing is to pick
If (!$Files) {
Msg($DISASTER_MSG);
End(1);
}
// Build and assemble menu
$Filemenu = "";
If ($Files) {
Foreach ($Item, $Files, "|") {
$Filemenu = $Filemenu . " $Item|<xyicons>\circle.ico"<crlf>;
$Filemenu = $Filemenu . " open(""$DIR_FILES\$Item"", , , ""l"");<crlf><crlf>";
}
$Filemenu = """$DIR_FILES|<xyicons>\folder.ico""" . ";" . "<crlf>" . "$Filemenu";
}
//Load($Filemenu, , s);
$MScript = $Filemenu;
Load($MScript, , s);