@ klownboy(Ken) Thanks for comments. What came to mind was the saying "More than one way to skin a cat".
I used _%d to add a numeral while I was testing. I wanted to show how easy to construct straight from documentation
into a script in XY.
Here's my latest. The first two scriptlets are results of coloring icons. The third was suggested recently.
You need to add montage.exe to the "_Initialize" at the beginning. I used a temp PaperFolder to select images.
The scriptlet gets the path to create a folder.jpg from the first selected pic.
Code: Select all
//submenu
"ImageMagic submenu 2 _»---|<xydata>\icons\xy-menu.ico : imm2 ME" Load("*","_ imm2 MD;-;_ imm2 A;_ imm2 B;_ imm2 C;_ imm2 D;_ imm2 E;_ imm2 F;_ imm2 G;_ imm2 H;_ imm2 I;_ imm2 J;_ imm2 K;_ imm2 L;_ imm2 M;_ imm2 N;_ imm2 O;_ imm2 P;_ imm2 Q;_ imm2 R;_ imm2 S;_ imm2 T;_ imm2 U;_ imm2 V;_ imm2 W;_ imm2 X;_ imm2 Y;_ imm2 Z;") ;
"<- BACK |: imm2 |1 : _ imm2 MD" Load("*");
"ColoR gamma 0.1-16 |<xydata>\icons\xy-script.ico : _ imm2 A";
$Clor = input("Enter the gamma 0.1-16" ,"(0.1,0.5,0)" ,"(0.1,0.5,0)");
run ("cmd /c $p_convert <curitem> -gamma $Clor gma_$Clor.ico");
"Color Name or HEX input |<xydata>\icons\xy-script.ico : _ imm2 B";
$Clor = input("Enter the Color Name" , ,"LightPink1");
run ("cmd /c $p_convert <curitem> +level-colors ,$Clor Fldr_$Clor.ico");
"montage|%Porta%\ImageMagick-6_8_9-0\images\wand.ico : _ imm2 C";
$SelectedItems = get("SelectedItemsPathNames", "<crlf>");
$path = getpathcomponent(gettoken($SelectedItems, 1, "<crlf>"), "path");
$cmdline = <<<CMD_LINE
cmd /c $p_montage -define jpeg:size=200x200 '*.jpg[32x32]' -strip
-geometry 32x32+5+5 -frame 4 $SelectedItems folder.gif
$p_convert folder.gif $path\folder.jpg
CMD_LINE;
$cmdline = Replace($cmdline, "<crlf>", ' ');
Run($cmdline, , 0, 0);
} msg "All Done";
// attrstamp("h",,"$path\folder.jpg") ;
" Generate Image Index Sheet (Current Folder) |:refresh : _ imm2 D";
if( exists("<curpath>\folder.jpg")==1){delete 0, 0, "<curpath>\folder.jpg";}
set $list;
$SelectedItems = get("SelectedItemsPathNames", "<crlf>");
foreach($item, $SelectedItems, <crlf>){
$list = $list"$item"<crlf>;}
$cmdline = <<<CMD_LINE
cmd /c $montage $list -geometry "250x180+1+1" -tile 5x "<curpath>\folder.jpg"
CMD_LINE;
$cmdline = Replace($cmdline, "<crlf>", ' ');
Run($cmdline, , 0, 0);
} msg "All Done";
" Generate Image Index Sheet (Current Folder and ALL Subs) |:refresh : _ imm2 E";
$parentDir=<curpath>; $images="";
$subDirs=folderreport("dirs", r, $parentDir, r);
$subDirs= $parentDir<crlf>$subDirs;
foreach($sub, $subDirs, <crlf>){
$i="";
if($sub==""){break 1;}
if( exists("$sub\folder.jpg")==1){delete 0, 0, "$sub\folder.jpg";}
$allFiles = folderreport("files", "r", $sub, , , "<crlf>");
foreach($item, $allFiles, <crlf>){
$a= getpathcomponent($item, "ext");
if($a == "bmp" OR $a=="jpg" OR $a=="jpeg" OR $a=="png"){
$i++;
$images=$images "$item"<crlf>;
$b= gettoken($allFiles, "count", "<crlf>", , );
}
if($i==15 OR $i==$b) { break 1;}
}
$cmdline = <<<CMD_LINE
cmd /c $montage $images -geometry "400x300+1+1" -background gray -tile 5x3 "$sub\folder.jpg"
CMD_LINE;
$cmdline = Replace($cmdline, "<crlf>", ' ');
Run($cmdline, , 0, 0);
$images="";
}
msg "All Done";
"hide image |<xyicons>\showhide.ico : _ imm2 F";
$a= popupmenu("Current Folder;c|-|Current Folder and ALL Subs;s");
if( $a=="s"){#311;}
selfilter "folder.jpg";
$SelectedItems = get("SelectedItemsPathNames", "|");
foreach($Item, $SelectedItems, "|") {
attrstamp("h", , "$Item");
}
/*
"07imm2 |<xydata>\icons\xy-script.ico : _ imm2 G"; open notepad ;
"08imm2 |<xydata>\icons\xy-script.ico : _ imm2 H"; open notepad ;
"09imm2 |<xydata>\icons\xy-script.ico : _ imm2 I"; open notepad ;
"10imm2 |<xydata>\icons\xy-script.ico : _ imm2 J"; open notepad ;
"11imm2 |<xydata>\icons\xy-script.ico : _ imm2 K"; open notepad ;
"12imm2 |<xydata>\icons\xy-script.ico : _ imm2 L"; open notepad ;
"13imm2 |<xydata>\icons\xy-script.ico : _ imm2 M"; open notepad ;
"14imm2 |<xydata>\icons\xy-script.ico : _ imm2 N"; open notepad ;
"15imm2 |<xydata>\icons\xy-script.ico : _ imm2 O"; open notepad ;
"16imm2 |<xydata>\icons\xy-script.ico : _ imm2 P"; open notepad ;
"17imm2 |<xydata>\icons\xy-script.ico : _ imm2 Q"; open notepad ;
"18imm2 |<xydata>\icons\xy-script.ico : _ imm2 R"; open notepad ;
"19imm2 |<xydata>\icons\xy-script.ico : _ imm2 S"; open notepad ;
"20imm2 |<xydata>\icons\xy-script.ico : _ imm2 T"; open notepad ;
"21imm2 |<xydata>\icons\xy-script.ico : _ imm2 U"; open notepad ;
"22imm2 |<xydata>\icons\xy-script.ico : _ imm2 V"; open notepad ;
"23imm2 |<xydata>\icons\xy-script.ico : _ imm2 W"; open notepad ;
"24imm2 |<xydata>\icons\xy-script.ico : _ imm2 X"; open notepad ;
"25imm2 |<xydata>\icons\xy-script.ico : _ imm2 Y"; open notepad ;
"26imm2 |<xydata>\icons\xy-script.ico : _ imm2 Z"; open notepad ;
//submenu
*/
I was impressed by the param in montage -tile .
Edited 22/11/2014
added last 3 scriptlets Note:msg All Done does not relate to end of production you should hear a sound when fully complete.
hide images can then be run to hide folder.jpg