Well I'm going to make tea now...
Cannot, as yet, find a way to load a jpeg directly to a newly created layer. Will try again later as all I can currently do is load a jpg file to a totally new document. Also cannot suss out javascript's variables enough to make the filename work from a string so currently testing it with filename coming from a dialog!
Anyway the newest version has adjustable boarders as requested (I will fix the centering on text within them after I have fixed this latest thing which is giving me a headache.......)
Come back PASCAL all is forgiven
This is the current position but it does not as yet work, please note there are lots of commented out statements etc as I am having to work out a lot of the javascript stuff using trial and error!
--------------------------------------------------------------------------------
function addcopyrightimage() **
alert("Copyright Image: Give me a chance !!!!!");
var docRef = activeDocument;
var filename = File.openDialog("Select file");
// Create a EPS option object [height & width are doc size]
var epsOpenOptions = new EPSOpenOptions;
epsOpenOptions.antiAlias = true;
// epsOpenOptions.height = // Deprecated for CS3
// epsOpenOptions.width = 600; // Deprecated for CS3
epsOpenOptions.mode = OpenDocumentMode.RGB;
epsOpenOptions.resolution = 200;
epsOpenOptions.page = 1;
epsOpenOptions.constrainProportions = true;
open( filename );
// var copydocRef = activeDocument;
// copydocRef.copytoclipboard;
activeDocument=docRef;
var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.NORMAL;
myLayerRef.name = "Copyright Image";
myLayerRef.image = docRef ;
// STILL TRYING TO LOAD IMAGE DIRECTLY TO NEW LAYER BUT WOULD SETTLE FOR OPENING IT AND COPYING IT TO THE NEW LAYER
// var id609 = charIDToTypeID( "Opn " );
// var desc131 = new ActionDescriptor();
// var id610 = charIDToTypeID( "null" );
// desc131.putPath( id610, new File( filename ) );
//executeAction( id609, desc131, DialogModes.NO );
// var myTextRef = myLayerRef.textItem;
// myTextRef.size = CT_Size;
// myTextRef.font = CT_Font;
// myTextRef.color = CT_Colour;
// myTextRef.fauxBold = CT_Bold;
// myTextRef.position = [ CT_X*PictureWidth/100, CT_Y*PictureHeight/100 ];
// myLayerRef.blendMode = BlendMode.NORMAL;
// myLayerRef.opacity = CT_Transparency;
// myTextRef.contents = CT_Text;
// AD.activeLayer.rotate(-CT_Angle,AnchorPosition.BOTTOMLEFT); // rotate the text
**