Another "very impressive" to you highend. I like the fact that it stays on top. I'll be able to make use of this in some existing scripts where currently a different technique is used.
Would there be any way to combine your stay-on-top VB script message with another VB script that provided a timed message (see below). The script was originally provided by Stefan here http://www.xyplorer.com/xyfc/viewtopic. ... age#p71980 So the message would stay on top but it would self destruct after a designated period. I'm thinking that if the user didn't respond (as in this example select the files required) within say 5 or 6 seconds the script would simple end, or possibly reload, or provide another message to say aborting or similar. If he selects the files and hits OK as he should, the script proceeds as normal.
Code: Select all
global $t_msg;
if (Get('CountSelected') < 2) {
$t_msg = "Make sure that all the files and folders that you want to process are selected in the list. Click OK when your selection is complete.";
Sub "_TIMED_MESSAGE";
}
Text Get('SelectedItemsPathNames'), /*width*/, /*height*/, 'You selected the following items:';
end 1;
"_TIMED_MESSAGE";
global $t_msg;
$waitSec = 6;
$out="";
foreach($line, $t_msg, "<crlf>"){ $out = $out . chr(34) . $line . chr(34) . " & vbCRLF _<crlf> & ";}
$out = replace($out, "&", "", ,strlen($out) -3, 1);
//Create the VBS file:
$VBS = <<<HEREDOC
text = $out
SET WS = CreateObject("WScript.Shell")
'//WshShell.Popup strMessage [,intSecondsToWait] [,strTitle] [,intType]
WS.popup text, $waitSec
HEREDOC;
writefile("<xyscripts>\tempVBS.vbs", $VBS);
run ("wscript ""<xyscripts>\tempVBS.vbs"""), ,2,0;
Ken
Edit: See example below with a timed message which stays-on-top.
XYplorer Beta Club