Re: SC Command ::Make...
Posted: 10 Apr 2014 17:09
1) will document
2) will fix
2) will fix
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Code: Select all
// 20140410: select a file and show a pic below it
$file = input("Enter filename (wildcards allowed)");
$row = row($file);
$column = "name";
sel $row;
$x = cell($row, $column, "x");
$y = cell($row, $column, "y") + cell($row, $column, "h") - 10; // 10 pixels up is better for this image
makecoffee "<xyscripts>\katy.png", 1/5, $x, $y;
Code: Select all
$row = row(<curitem>);
$column = "name";
sel $row;
$x = cell($row, $column, "x");
$y = cell($row, $column, "y") + cell($row, $column, "h") - 10; // 10 pixels up is better for this image
if ((property("#11", "<curitem>")) == "Picture") {
makecoffee "<curitem>", 1/2, $x, $y; wait 2000; makecoffee ""}
Code: Select all
Select Case LCase$(sParams(2))
Case "l", "left", "x": sRet = CStr(rCell.Left)
Case "t", "top", "y": sRet = CStr(rCell.Top)
Case "r", "right": sRet = CStr(rCell.Right)
Case "b", "bottom": sRet = CStr(rCell.Bottom)
Case "w", "width": sRet = CStr(rCell.Right - rCell.Left)
Case "h", "height": sRet = CStr(rCell.Bottom - rCell.Top)
End Select
Code: Select all
$re = "";
$x = 180;
$y = 50;
$max = 3;
$x1 = $x;
$y1 = $y;
$a = get(selecteditemspathnames);
foreach($tk, "$a", <crlf>) {
$ctrl++;
IF($ctrl == $max) { $x = $x1; $y = $y + 40; $ctrl = 0; }
ELSE { }
$x = $x + 40;
// step;
$prop = property("#image.dimensions", $tk);
$p = gettoken($prop, 1, " x");
$fact = $p \ 100;
IF($fact <= 1) { $mult = 10; }
ELSEIF($fact == 2) { $mult = 9; }
ELSEIF($fact == 3) { $mult = 8; }
ELSEIF($fact == 4) { $mult = 7; }
ELSEIF($fact == 5) { $mult = 6; }
ELSEIF($fact == 6) { $mult = 5; }
ELSEIF($fact == 7) { $mult = 4; }
ELSEIF($fact == 8) { $mult = 3; }
ELSEIF($fact == 9) { $mult = 2; }
ELSEIF($fact >= 10) { $mult = 1; }
// ELSEIF($fact == ) { $mult = ; }
makecoffee "$tk", $mult/10, $x, $y;
}
/*
$re = "";
$x = 180;
$y = 50;
$max = 3;
$x1 = $x;
$y1 = $y;
$a = get(selecteditemspathnames);
foreach($tk, "$a", <crlf>) {
$ctrl++;
IF($ctrl == $max) { $x = $x1; $y = $y + 40; $ctrl = 0; }
ELSE { }
$x = $x + 40;
// text property("#image.dimensions", $tk);
// step;
makecoffee "$tk", 1/5, $x, $y;
}
*/
Explain a little more, please.SkyFrontier wrote:Don, is it easy for you to confine different resolutions of images into a resolution for all thumbs?
Code: Select all
Snip: CustomColumn 1
XYplorer 13.90.0107, 12.04.2014 12:05:31
Action
ConfigureColumn
Caption
Preview
Type
3
Definition
// 20140412: on click: show a preview pic below the name for 2 seconds
$file = <cc_item>;
$row = row($file);
$column = "name";
$x = cell($row, $column, "x");
$y = cell($row, $column, "b");
makecoffee $file, $x, $y, 200, 200;
wait 2000; makecoffee "";
Format
0
Trigger
2
Item Type
0
Item Filter
jpg;png;gif
Well, maybe "showpicture" could be added as an alias to makecoffee, much like rtfm for help.PeterH wrote:So the command maybe should be renamed to something like "showpicture" before too much scripts exist with makecoffe?