Code: Select all
/types={:Video}
/types={:Audio} /exclfile=*.mp4
Code: Select all
/types={:Video}
/types={:Audio} /exclfile=*.mp4
Code: Select all
$options = "/types={:Video};{:Audio} /exclfile=*.mp4";
goto "<curpath>?$options";
simplicity: items are shown in drop menu - easy to edit - no need for command caption nor search captionhighend wrote:What is the difference to a script inside the button like this?
Code: Select all
// DO NOT EDIT THIS SCRIPT
perm $P_QSOptions;
if (!$P_QSOptions) { $P_QSOptions = "<no options defined>"; }
$qsCaption = "Quick search!";
$menu = $P_QSOptions . <crlf> . "-". <crlf> . $qsCaption;
$selection = popupnested($menu, , , , , , <crlf>, "<::>");
end !$selection;
if ($selection UnLikeI $qsCaption) {
$P_QSOptions = input("Edit quick search options...", "One item per line!", $P_QSOptions, "m", , 250, 400);
}
$P_QSOptions = regexreplace($P_QSOptions, "^<no options defined>.*(\r?\n|$)");
goto "<curpath>?" . regexreplace($P_QSOptions, "\r?\n", " ");
Code: Select all
$menu = <<<MENU
Video;/types={:Video}
Audio;/types={:Audio}
MENU;
$s = popupmenu("$menu");if !($s) { end 1==1; };
goto "?$s";
You can't split options like /types into multiple ones here
Code: Select all
Correct
/types={:Audio}
/types={:Video}
INCORRECT:
/types={:Audio}
/exclfile=*.mp4
/types={:Video}
Code: Select all
C:\ProgramData
D:\Temp
\\server\folder\subfolder
Code: Select all
Correct
/types={:Audio}
*.srt
*.idx
INCORRECT:
/types={:Audio}
D:\Temp
*.srt
Code: Select all
// DO NOT EDIT THIS SCRIPT
perm $P_QSOptions;
if (!$P_QSOptions) { $P_QSOptions = "<no options defined>"; }
$qsCaption = "Quick search!";
$menu = $P_QSOptions . <crlf> . "-". <crlf> . "$qsCaption<::><::>:find";
$selection = popupnested($menu, , , , , , <crlf>, "<::>");
end !$selection;
if ($selection UnLikeI $qsCaption) {
$P_QSOptions = input("Edit quick search options...", "One item per line!", $P_QSOptions, "m", , 250, 400);
}
$P_QSOptions = regexreplace($P_QSOptions, "^<no options defined>.*(\r?\n|$)");
// Parse options
$folders = "";
$options = "";
foreach($entry, $P_QSOptions, <crlf>, "e") {
// Is it a known option?
$optionType = (regexmatches($entry, "^\s*/")) ? trim(gettoken($entry, 1, "=")) : "";
// Is it a path?
if (regexmatches($entry, "^\s*([a-z]:|\\\\)")) {
// Path exists? Add it! Does not exist? Ignore it!
if (exists(trim($entry)) == 2) { $folders = $folders . ((!$folders) ? $entry : ";" . $entry); }
// Is it an option?
} elseif ($optionType) {
// The same as the last option? Combine!
if ($optionType LikeI $lastOptionType) { $options = $options . ";" . trim(gettoken($entry, 2, "=")); }
// A new option?
else { $options = $options . <crlf> . $entry; }
// If not, add it to the previous option!
} else { $options = $options . ";" . $entry; }
$lastOptionType = $optionType;
}
// text "Options:<crlf>$options<crlf 2>Folders:<crlf>$folders";
goto "$folders?" . regexreplace($options, "\r?\n", " ");
Code: Select all
$g = get("drives");$g = replace("$g", "\", "");
// nested foreach loops
foreach($token, "$g") {
foreach($token2, "load", "<crlf>") {
writefile("%temp%\load.txt", "$token2 $token", "a");
}
};
Code: Select all
load C:
load E:
load F:
Code: Select all
$batFile = "%TEMP%\~fltmc.bat";
$drives = get("drives", , <crlf>);
$drives = regexreplace($drives, "\\$");
$drives = regexreplace($drives, "^(.)", "fltmc attach AccessGainDriver $1");
writefile($batFile, $drives);
$vbsFile = "%TEMP%\~OpenElevatedCMD.vbs";
$vbsContent = <<<>>>
Set UAC = CreateObject("Shell.Application")
UAC.ShellExecute "cmd.exe", "/c ""$batFile""", "", "runas", 1
>>>;
writefile($vbsFile, $vbsContent);
run """cscript.exe"" ""$vbsFile"" //nologo", , 0, 0;
Code: Select all
$names = get("selecteditemsnames", "<crlf>");
$paths = get(SelectedItemsPathNames, "<crlf>");
Code: Select all
text regexreplace(<get "SelectedItemsPathNames" <crlf>>, "(^.*)\\(.*)", "$2 $1");