SC Command ::Make...
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: SC Command ::Make...
I think you can deduct usage from this example:
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;
FAQ | XY News RSS | XY Twitter
Re: SC Command ::Make...
I'm not adept yet at using the column script jargon yet, but after seeing Don's example above I tried this little script on any photo or picture. It will display the image half size below the file for a couple of seconds and then close. What I like is that it will work on any image in any mode not just details view.
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 ""}
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440
Re: SC Command ::Make...
cell(rowIdx, columnCaption, param);
param can be:
'w' width
'h' height
'x' x-position of left edge, relative to list's top-left.
'y' y-position of top edge, relative to list's top-left.
Anything else?
param can be:
'w' width
'h' height
'x' x-position of left edge, relative to list's top-left.
'y' y-position of top edge, relative to list's top-left.
Anything else?
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: SC Command ::Make...
Here is some XY source code that tells you the rest:
Urgs, I just see how stupid I was in my example:
Instead of
cell($row, $column, "y") + cell($row, $column, "h")
I could have simply done
cell($row, $column, "b")
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
Instead of
cell($row, $column, "y") + cell($row, $column, "h")
I could have simply done
cell($row, $column, "b")
FAQ | XY News RSS | XY Twitter
Re: SC Command ::Make...
Don, your makecoffee enhancenments work very nicely when you assign a default PFA for a PNG file especially since many tend to have the transparent background. Use a small script, something similar to the one I posted above (though that one could be slimmed down substantially especially if you're using it strictly for PNG files). It's better in some respects then opening the file with different viewer, at least when you're not in thumbnail view mode, since you only need to double-click on the file, the PNG pic displays and then disappears after a couple of seconds without you having to click to close the file. Very handy indeed.
Thanks,
Ken
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440
-
- Posts: 2341
- Joined: 04 Jan 2010 14:27
- Location: Pasárgada (eu vou!)
Re: SC Command ::Make...
Guys,
I'm working on a way to quick display in a grid of thumbs several images spread over different source folders.
Any ideas on how to improve this?
Don, is it easy for you to confine different resolutions of images into a resolution for all thumbs?
Beta*:
*Works ok on same-res images, tho.
I'm working on a way to quick display in a grid of thumbs several images spread over different source folders.
Any ideas on how to improve this?
Don, is it easy for you to confine different resolutions of images into a resolution for all thumbs?
Beta*:
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;
}
*/
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: SC Command ::Make...
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?
FAQ | XY News RSS | XY Twitter
-
- Posts: 2341
- Joined: 04 Jan 2010 14:27
- Location: Pasárgada (eu vou!)
Re: SC Command ::Make...
If different resolution images are selected as source for my script and I apply '1/10' to all of them, the generated thumbs will not have a common resolution under which each thumb is displayed.
So a fixed resolution, user defined, could be supported as stretchfactor (BESIDES current method, not replacing it! - it´s good as it is for specifc purposes).
So a fixed resolution, user defined, could be supported as stretchfactor (BESIDES current method, not replacing it! - it´s good as it is for specifc purposes).
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: SC Command ::Make...
Okay, got it.
I'm currently working on the next killa featua. I might be able to squeeze yours in...
I'm currently working on the next killa featua. I might be able to squeeze yours in...
FAQ | XY News RSS | XY Twitter
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: SC Command ::Make...
This column will show a preview pic below the name for 2 seconds on click:
Note that in the current beta v13.90.0107 there is still a bug where the Click column is completely generated after you select it into a new column (you will get a slideshow ). Fix comes.
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
FAQ | XY News RSS | XY Twitter
Re: SC Command ::Make...
Maybe the "show a picture" - functionality of makecoffe will most be used to show a picture? So the command maybe should be renamed to something like "showpicture" before too much scripts exist with makecoffe?
And is it possible to add a display-time as a new operand (instead of having to code Wait to delete it)?
And is it possible to add a display-time as a new operand (instead of having to code Wait to delete it)?
Win11 Pro 223H2 Gerrman
Re: SC Command ::Make...
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?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Don sees all [cit. from viewtopic.php?p=124094#p124094]
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: SC Command ::Make...
Well, this still has easteregg status for me.
FAQ | XY News RSS | XY Twitter