Page 2 of 2
Re: Enabl button on selection only
Posted: 08 Sep 2014 17:00
by TheQwerty
SammaySarkar wrote:highend wrote:Balloon tips aren't supported you'd need an external tool to display them.
winapiexec should fit the bill nicely...
There's also
nircmd which makes it incredibly easy:
Code: Select all
run <<<COMMAND
"nircmd.exe" trayballoon "XYplorer" "XYplorer is the best." "<xy>" 5000
COMMAND
,, 0, 0;
Re: Enabl button on selection only
Posted: 08 Sep 2014 17:40
by PeterH
SammaySarkar wrote:U_2, the separator is a necessary evil dummy.
Though you can use it to display multiple lines:
Code: Select all
load <<<#>>>>
"Nothing selected in filelist,|<xyicons>\scheme\crosss.ico" end 1;
"so we TERMINATE." End 1; #>>>>,,s;
end 1;
By the way: the label(s) should start in column one, I think.
Really a cool idea to use Load this way
(I prefer the code multiline - but that's just personal)
Re: Enabl button on selection only
Posted: 08 Sep 2014 17:51
by bdeshi
PeterH wrote:the label(s) should start in column one, I think.
Apparently the very first label (
only) can be indented.
Re: Enabl button on selection only
Posted: 08 Sep 2014 18:28
by PeterH
SammaySarkar wrote:PeterH wrote:the label(s) should start in column one, I think.
Apparently the very first label (
only) can be indented.
You know my personal style?
Do you want to say
- 'can', i.e. doesn't bring an error (in the moment, at least),
- or 'is allowed', as documented?
Why do I think this way? Sometimes, when creating / changing scripts, the result is "rather strange" - for examples comments are not treated as expected, heredoc, multi script files, or whatever. And then the searching begins...
In these situations it's at least good, if syntax rules have been followed as close as possible.

Re: Enabl button on selection only
Posted: 08 Sep 2014 18:48
by bdeshi
I agree with you. I don't deviate from the normal syntax, but in this case I'm quite sure that's syntactically correct. Logically at least.
Re: Enabl button on selection only
Posted: 09 Sep 2014 11:53
by U_2582
PeterH,
The multi-line looks much better than the separator, but why is the second line grayed out?!
Btw, Your code didn't work for me, needed
<crlf>
Code: Select all
load <<<#>>>>
"Nothing selected in the file list.|<xyicons>\cross.ico" end 1;
<crlf>"Select something and try again."#>>>>,,s;
end 1;
Maybe its a good idea to add balloon tip to xy wish list
Using external resources should be for more important things. (personal opinion)
Re: Enabl button on selection only
Posted: 09 Sep 2014 12:08
by bdeshi
U_2582 wrote:but why is the second line grayed out?
needs some command to be active.
Add an
end 1; after "Select something and try again."
Re: Enabl button on selection only
Posted: 09 Sep 2014 13:50
by TheQwerty
HTML with JavaScript redirection after 3 seconds:
Code: Select all
"popup"
$G_MSG = "Nothing selected!";
$G_TIMEOUT_SECONDS = 3;
html(<<<#HTML
<html><body>
<h1>$G_MSG</h1>
<script>window.setTimeout(function() { window.location = 'xys:timeout'; }, $G_TIMEOUT_SECONDS * 1000);</script>
</body></html>
#HTML);
Re: Enabl button on selection only
Posted: 09 Sep 2014 13:57
by U_2582
TheQwerty wrote:HTML with JavaScript redirection after 3 seconds:
Code: Select all
"popup"
$G_MSG = "Nothing selected!";
$G_TIMEOUT_SECONDS = 3;
html(<<<#HTML
<html><body>
<h1>$G_MSG</h1>
<script>window.setTimeout(function() { window.location = 'xys:timeout'; }, $G_TIMEOUT_SECONDS * 1000);</script>
</body></html>
#HTML);
lol
I think multi-line popup menu is best solution for now, although I would like a one item popup menu without a separator and with an icon more.
Thanks all.
Re: Enabl button on selection only
Posted: 09 Sep 2014 13:59
by PeterH
U_2582 wrote:PeterH,
The multi-line looks much better than the separator, but why is the second line grayed out?!
Btw, Your code didn't work for me, needed
<crlf>
Code: Select all
load <<<#>>>>
"Nothing selected in the file list.|<xyicons>\cross.ico" end 1;
<crlf>"Select something and try again."#>>>>,,s;
end 1;
One tip exactly as Sammay said: re-add
End 1;
I just copied my example from above and pasted it to Try Script

exactly works as expected, without
<crlf>, but with
End 1; and
blanks in front of line 1 and 4.
Re: Enabl button on selection only
Posted: 09 Sep 2014 17:26
by klownboy
I suppose if you don't like the 2 lines or have no need for 2 lines you can always even the message out by having 3 lines (but 3 is not even!). Top and bottom could be blank with the middle line being the message or you could do something like this...
error_message_cap.png
Code: Select all
$p_selCount = get("selectedItemsNames");
if ($p_selCount == ""){
load <<<#>>>>
"-------------------------------";
" Nothing selected in filelist|:favs" end 1;
"-------------------------------"; #>>>>,,s;
end 1;}
The fat dot is a BEL character made by holding alt and hitting 007 on the numpad (doesn't show in the pasted code). Thanks again Sammay for a clever trick.