Fun with "the templateimage"
Posted: Thu Oct 31, 2019 10:11 am
Hi all,
after the overwhelming response from the mailing list, I decided to share this snippet here, too!
We know that "the templatexxxxxx" is a very helpful thingie.
But I did not know that we can even EXPORT something from the templateimage until I tried this:
No image object involved, how cool is that?! 
Best & happy Halloween
Klaus
after the overwhelming response from the mailing list, I decided to share this snippet here, too!
We know that "the templatexxxxxx" is a very helpful thingie.
But I did not know that we can even EXPORT something from the templateimage until I tried this:
Code: Select all
on mouseUp
set the filename of the templateimage to "/Users/klaus2/Desktop/a nice image.jpg"
## This was a know (to me) feature
put the formattedwidth of the templateimage into tFW
put the formattedheight of the templateimage into tFH
## Now you can apply some "rule of three" to scale the image while preserving its ratio
## I'll leave that up to you... :-)
## I cheated a bit:
set the width of the templateimage to 181
set the height of the templateimage to 252
## But this one really suprised me:
export the templateimage to file (specialfolderpath("desktop") & "/eltesto.jpg") as JPEG
reset the templateimage
end mouseUp

Best & happy Halloween
Klaus