I tried it and it didn't work.
//dlg.Control("static3").label = Script.LoadImage("Everything24.ico"); // Icon
dlg.Control("static3").label = ScriptInitData.AddCommand.icon("Everything24.ico") // Icon
I couldn't find it in the help documentation and forum.
function OnClick(clickData)
{
//-- Add string trim() method
String.prototype.trim = function(s){s=s||"\\s";return this.replace(new RegExp("^("+s+"){1,}\|("+s+"){1,}$","g"),"");}
var cmd = clickData.func.command;
var tab = clickData.func.sourcetab;
// Read the history of the EverythingForDopus_History.ini file
var filepath = "%appdata%\\GPSoftware\\Directory Opus\\Scripts\\INI\\EverythingForDopus_History.ini"; //File path
fsu = DOpus.FSUtil;
var ST = DOpus.Create.StringTools();
if(fsu.Exists(filepath)) {
var bom = fsu.OpenFile(filepath).Read();
textbom = ST.Decode(bom, "utf-8 bom");
} else {
var textbom = "";
}
var dlg = DOpus.Dlg;
dlg.title = "Directory Opus"; // Tittle
dlg.template = "dlgCombox";
dlg.detach = true;
dlg.Create();
dlg.Control("static").style = "b";
dlg.Control("static").label = "[Everything]"; // Topic
dlg.Control("static2").label = "Enter Everything Search Query\nYou can do a /regex search \d\d\d/ using slashes"; // Notes
//dlg.Control("static3").label = Script.LoadImage("Everything24.ico"); // Icon
dlg.Control("static3").label = ScriptInitData.AddCommand.icon("Everything24.ico") // Icon
var myArray = textbom.split("\r\n"); //Seprator
if(clickData.func.sourcetab.selected.count==1){
promptstr = clickData.func.sourcetab.selected(0).name_stem_m;
dlg.Control("combo").label = promptstr; //Default value
} else {
dlg.Control("combo").label = myArray[0];
}
dlg.Control("combo").SelectRange(0, -1); //Select Default value
for(i = 0; myArray[i]; i++) {
dlg.Control("combo").AddItem(myArray[i]); //Add each item to drop-down list
}
dlg.Show();
//msg loop
do
{
msg = dlg.GetMsg();
/*
//Selection
if(msg == true && dlg.Control("combo").focus == true) {
DOpus.Output(dlg.Control("combo").label);
}
*/
//Result
if(dlg.result == 1) {
var fixstr = dlg.Control("combo").label;
searchString = fixstr.trim().replace(/\|/g,' |');
} else {
if(dlg.result == 0) {
return
}
}
/*
//If the button 3 is pressed
if(dlg.result == 2) {
var fixstr = dlg.Control("combo").label;
fixstr = fixstr.trim().replace(/\|/g,' |');
searchString2 = searchString;
searchString = fixstr+" path:"+maybe_quote(path);
}
//If the button 4 is pressed
if(dlg.result == 3) {
var fixstr = dlg.Control("combo").label;
fixstr = fixstr.trim().replace(/\|/g,' |');
searchString2 = searchString;
searchString = fixstr+" parent:"+maybe_quote(path);
}
*/
} while (msg == true);
cmd.AddLine("@nofilenamequoting");
cmd.AddLine('EverythingDopus "' + searchString+ '"')
cmd.Run();
if(searchString) {
var newHistory = "";
for(i = 0; myArray[i]; i++) {
if(i == 15) {break};
if(searchString != myArray[i]) {newHistory += "\r\n" + myArray[i]};
}
newHistory = searchString + newHistory;
var oFileWrite = fsu.OpenFile (filepath, "wa");
var utf8blob = ST.Encode(newHistory, "utf-8 bom");
if(oFileWrite.error == 0)
{
oFileWrite.Write (utf8blob)
}
oFileWrite.Close ()
}
}
==SCRIPT RESOURCES
<resources>
<resource name="dlgCombox" type="dialog">
<dialog fontsize="8" height="88" lang="english" resize="yes" title="Directory Opus" width="322">
<control edit="yes" height="40" name="combo" type="combo" width="306" x="8" y="50" />
<control close="3" height="14" name="btn4" resize="xy" title="&Here" type="button" visible="no" width="60" x="81" y="67" />
<control close="2" height="14" name="btn3" resize="xy" title="&Below" type="button" visible="no" width="60" x="145" y="67" />
<control halign="left" height="8" name="static" title="Topic" type="static" valign="top" width="280" x="30" y="10" />
<control halign="left" height="16" name="static2" title="Notes" type="static" valign="top" width="280" x="30" y="22" />
<control halign="center" height="14" image="yes" name="static3" title="Icon" type="static" valign="top" width="14" x="8" y="7" />
<control close="1" default="yes" height="14" name="btnOK" resize="xy" title="&OK" type="button" width="50" x="209" y="67" />
<control close="0" height="14" name="btnCancel" resize="xy" title="&Cancel" type="button" width="50" x="263" y="67" />
</dialog>
</resource>
</resources>