Create images with dynamic width from 3 images each (left/center/right-part)

Hello,
i want to employ a script to create images of dynamic width for me. The whole process shall base on different sized sets of images, which contain a left-image, a right-image and a center-image. The desired width for the different cases shall be reached by duplicating the center-image between the two outer images and placing those images next to each other until the image extends to desired width.
The layers importet into Photoshop shall be importet as smart-layers (which i already solved).
Has anyone done something similar already and could give me some useful hints on that issue ?
I have come up to this until now:
#target Photoshop
// =========================== Opens a new document and asks for dimensions ============================
var myLayerset = File.openDialog ("Select the set of images you want to use!", "*.png",true)
var myName = prompt("How do you want to call the document?"); // askes for document name
var width =  prompt("Please insert width for the output here!", ""); // askes for desired width
var height = prompt("Please insert height for the output here!", ""); //askes for desired height
var docName = myName +".psd"
var idMk = charIDToTypeID( "Mk  " );
    var desc3 = new ActionDescriptor();
    var idNw = charIDToTypeID( "Nw  " );
        var desc4 = new ActionDescriptor();
        var idNm = charIDToTypeID( "Nm  " );
        desc4.putString( idNm, """Wunschname""" );
        var idMd = charIDToTypeID( "Md  " );
        var idRGBM = charIDToTypeID( "RGBM" );
        desc4.putClass( idMd, idRGBM );
        var idWdth = charIDToTypeID( "Wdth" );
        var idRlt = charIDToTypeID( "#Rlt" );
        desc4.putUnitDouble( idWdth, idRlt, width );
        var idHght = charIDToTypeID( "Hght" );
        var idRlt = charIDToTypeID( "#Rlt" );
        desc4.putUnitDouble( idHght, idRlt, height );
        var idRslt = charIDToTypeID( "Rslt" );
        var idRsl = charIDToTypeID( "#Rsl" );
        desc4.putUnitDouble( idRslt, idRsl, 72.000000 );
        var idpixelScaleFactor = stringIDToTypeID( "pixelScaleFactor" );
        desc4.putDouble( idpixelScaleFactor, 1.000000 );
        var idFl = charIDToTypeID( "Fl  " );
        var idFl = charIDToTypeID( "Fl  " );
        var idTrns = charIDToTypeID( "Trns" );
        desc4.putEnumerated( idFl, idFl, idTrns );
        var idDpth = charIDToTypeID( "Dpth" );
        desc4.putInteger( idDpth, 8 );
        var idprofile = stringIDToTypeID( "profile" );
        desc4.putString( idprofile, """sRGB IEC61966-2.1""" );
    var idDcmn = charIDToTypeID( "Dcmn" );
    desc3.putObject( idNw, idDcmn, desc4 );
executeAction( idMk, desc3, DialogModes.NO );
//==============================================save document================================================
var idsave = charIDToTypeID( "save" );
    var desc4 = new ActionDescriptor();
    var idAs = charIDToTypeID( "As  " );
        var desc5 = new ActionDescriptor();
        var idmaximizeCompatibility = stringIDToTypeID( "maximizeCompatibility" );
        desc5.putBoolean( idmaximizeCompatibility, true );
    var idPhtthree = charIDToTypeID( "Pht3" );
    desc4.putObject( idAs, idPhtthree, desc5 );
    var idIn = charIDToTypeID( "In  " );
    desc4.putPath( idIn, new File( "C:\\Users\\ target folder goes here" + docName ) );
    var idDocI = charIDToTypeID( "DocI" );
    desc4.putInteger( idDocI, 308 );
    var idsaveStage = stringIDToTypeID( "saveStage" );
    var idsaveStageType = stringIDToTypeID( "saveStageType" );
    var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
    desc4.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
executeAction( idsave, desc4, DialogModes.NO );
//========================================================================================================
for (var i = 0; i < myLayerset.length; i++) {
if (myLayerset[i] instanceof File && myLayerset[i].hidden == false) {
// ======================================================= opens selected images as smart objects====================
var idOpn = charIDToTypeID( "Opn " );
    var desc1 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
   desc1.putPath( idnull, myLayerset[i]);
    var idsmartObject = stringIDToTypeID( "smartObject" );
    desc1.putBoolean( idsmartObject, true );
executeAction( idOpn, desc1, DialogModes.NO );
//===================================duplicates opened layer into created document========================================
var idDplc = charIDToTypeID( "Dplc" );
    var desc144 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref135 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref135.putEnumerated( idLyr, idOrdn, idTrgt );
    desc144.putReference( idnull, ref135 );
    var idT = charIDToTypeID( "T   " );
        var ref136 = new ActionReference();
        var idDcmn = charIDToTypeID( "Dcmn" );
        ref136.putName( idDcmn, docName); 
    desc144.putReference( idT, ref136 );
    var idVrsn = charIDToTypeID( "Vrsn" );
    desc144.putInteger( idVrsn, 5 );
executeAction( idDplc, desc144, DialogModes.NO );
// ======================================================= close tab without saving ==========
var idCls = charIDToTypeID( "Cls " );
    var desc156 = new ActionDescriptor();
    var idSvng = charIDToTypeID( "Svng" );
    var idYsN = charIDToTypeID( "YsN " );
    var idN = charIDToTypeID( "N   " );
    desc156.putEnumerated( idSvng, idYsN, idN );
executeAction( idCls, desc156, DialogModes.NO );

I adapted a Script somewhat, so you may give this a test.
But it uses the open file so you would have to adapt it further.
// arranges the selected jpg, tif, psd in line;
// gutters may be irregular due to rounding effects;
// thanks to michael l hale and muppet mark;
// for mac and CS6;
// 2014, use it at your own risk;
#target photoshop
if (app.documents.length == 0) {
          var myDocument = app.documents.add(UnitValue (300, "mm"), UnitValue (50, "mm"), 300, "new", NewDocumentMode.RGB, DocumentFill.TRANSPARENT)
else {myDocument = app.activeDocument};
// set to pixels;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var theArray = [0, 0, myDocument.width, myDocument.height];
// select files;
if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog ("please select files", '*.jpg;*.tif;*.pdf;*.psd', true)}
else {var theFiles = File.openDialog ("please select exactly three files", getFiles, true)};
// do the arrangement
if (theFiles) {placeInLines (myDocument, theFiles, theArray)}
app.preferences.rulerUnits = originalRulerUnits;
////// function to place images in lines //////
function placeInLines (myDocument, theFiles, theArray) {
theFiles.sort();
// fit on screen;
var idslct = charIDToTypeID( "slct" );
var desc64 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref44 = new ActionReference();
var idMn = charIDToTypeID( "Mn  " );
var idMnIt = charIDToTypeID( "MnIt" );
var idFtOn = charIDToTypeID( "FtOn" );
ref44.putEnumerated( idMn, idMnIt, idFtOn );
desc64.putReference( idnull, ref44 );
executeAction( idslct, desc64, DialogModes.NO );
// change pref;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
setToAccelerated();
app.togglePalettes();
var check = turnOffRescale ();
// create the arrangement;
if (theFiles.length > 0 && theFiles.length == 3) {
myDocument.activeLayer = myDocument.layers[0];
// create masked group;
var theGroup = myDocument.layerSets.add();
theGroup.name = "arrangement";
// determine the array’s values;
var areaWidth = theArray[2] - theArray[0];
var areaHeight = theArray[3] - theArray[1];
var theDocResolution = myDocument.resolution;
var areaRelation = areaHeight / areaWidth;
// center of placed non-pdf images;
var centerX = Number(myDocument.width / 2);
var centerY = Number(myDocument.height / 2);
// suppress dialogs;
var theDialogSettings = app.displayDialogs;
app.displayDialogs = DialogModes.NO;
var pdfSinglePages = new Array;
var nonPDFs = new Array;
var theDimPDFs = new Array;
var theLength = 0;
// collect the files’ measurements;
var theDimensions = new Array;
var theLengths = new Array;
// array to collect both files and placed pdf-pages;
var theseFiles = new Array;
var theLength = 0;
// collect the files’ measurements;
for (var o = 0; o < theFiles.length; o++) {
    var thisFile = theFiles[o];
          theseFiles.push(thisFile);
          var theDim = getDimensions(thisFile);
          theDimensions.push(theDim);
          theRelativeWidth = 100 / theDim[1] * theDim[0];
          theLength = theLength + theRelativeWidth;
// reset dialogmodes;
app.displayDialogs = DialogModes.ERROR;
// if three files;
if (theseFiles.length == 3) {
// create the layers;
var theNumber = 0;
var theAdded = 0;
var y = areaHeight / 2;
// add placed image’s width;
var thisLineWidth = 0 + theAdded;
var theLastFactor = Number (Number(myDocument.height) / theDimensions[2][1] * theDimensions[2][2] / theDocResolution * 100);
var theLastWidth = Math.round(theDimensions[2][0] * theLastFactor / 100 * theDocResolution / theDimensions[2][2]);
// place the files;
for (var x = 0; x < 3; x++) {
var theNumber = x;
var thisFile = theseFiles[theNumber];
var theFactor = Number (Number(myDocument.height) / theDimensions[theNumber][1] * theDimensions[theNumber][2] / theDocResolution * 100);
var theNewWidth = Math.round(theDimensions[theNumber][0] * theFactor / 100 * theDocResolution / theDimensions[theNumber][2]);
var offsetX = theNewWidth / 2 + thisLineWidth - centerX + theArray[0];
var offsetY = y - centerY + theArray[1];
var theLayer = placeScaleFile (thisFile, offsetX, offsetY, theFactor, theFactor);
myDocument.activeLayer.move(theGroup, ElementPlacement.PLACEATBEGINNING);
thisLineWidth = thisLineWidth + theNewWidth;
// duplicate the middle one;
if (theNumber == 1) {
          while (thisLineWidth < myDocument.width - theLastWidth) {
                    theLayer = duplicateAndOffset (theLayer, theNewWidth, 0);
                    thisLineWidth = thisLineWidth + theNewWidth;
// reset;
app.togglePalettes();
turnOnRescale (check);
app.preferences.rulerUnits = originalRulerUnits;
////// playback to accelerated //////
function setToAccelerated () {
          var idsetd = charIDToTypeID( "setd" );
          var desc1 = new ActionDescriptor();
          var idnull = charIDToTypeID( "null" );
                    var ref1 = new ActionReference();
                    var idPrpr = charIDToTypeID( "Prpr" );
                    var idPbkO = charIDToTypeID( "PbkO" );
                    ref1.putProperty( idPrpr, idPbkO );
                    var idcapp = charIDToTypeID( "capp" );
                    var idOrdn = charIDToTypeID( "Ordn" );
                    var idTrgt = charIDToTypeID( "Trgt" );
                    ref1.putEnumerated( idcapp, idOrdn, idTrgt );
          desc1.putReference( idnull, ref1 );
          var idT = charIDToTypeID( "T   " );
                    var desc2 = new ActionDescriptor();
                    var idperformance = stringIDToTypeID( "performance" );
                    var idperformance = stringIDToTypeID( "performance" );
                    var idaccelerated = stringIDToTypeID( "accelerated" );
                    desc2.putEnumerated( idperformance, idperformance, idaccelerated );
          var idPbkO = charIDToTypeID( "PbkO" );
          desc1.putObject( idT, idPbkO, desc2 );
          executeAction( idsetd, desc1, DialogModes.NO );
////// get psds, tifs and jpgs from files //////
function getFiles (theFile) {
    if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {
        return true
////// place //////
function placeScaleFile (file, xOffset, yOffset, theScale) {
// =======================================================
var idPlc = charIDToTypeID( "Plc " );
    var desc5 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    desc5.putPath( idnull, new File( file ) );
    var idFTcs = charIDToTypeID( "FTcs" );
    var idQCSt = charIDToTypeID( "QCSt" );
    var idQcsa = charIDToTypeID( "Qcsa" );
    desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
    var idOfst = charIDToTypeID( "Ofst" );
        var desc6 = new ActionDescriptor();
        var idHrzn = charIDToTypeID( "Hrzn" );
        var idPxl = charIDToTypeID( "#Pxl" );
        desc6.putUnitDouble( idHrzn, idPxl, xOffset );
        var idVrtc = charIDToTypeID( "Vrtc" );
        var idPxl = charIDToTypeID( "#Pxl" );
        desc6.putUnitDouble( idVrtc, idPxl, yOffset );
    var idOfst = charIDToTypeID( "Ofst" );
    desc5.putObject( idOfst, idOfst, desc6 );
    var idWdth = charIDToTypeID( "Wdth" );
    var idPrc = charIDToTypeID( "#Prc" );
    desc5.putUnitDouble( idWdth, idPrc, theScale );
    var idHght = charIDToTypeID( "Hght" );
    var idPrc = charIDToTypeID( "#Prc" );
    desc5.putUnitDouble( idHght, idPrc, theScale );
    var idLnkd = charIDToTypeID( "Lnkd" );
    desc5.putBoolean( idLnkd, true );
executeAction( idPlc, desc5, DialogModes.NO );
return myDocument.activeLayer;
////// open pdf //////
function openPDF (theImage, x) {
// define pdfopenoptions;
var pdfOpenOpts = new PDFOpenOptions;
pdfOpenOpts.antiAlias = true;
pdfOpenOpts.bitsPerChannel = BitsPerChannelType.EIGHT;
pdfOpenOpts.cropPage = CropToType.TRIMBOX;
pdfOpenOpts.mode = OpenDocumentMode.CMYK;
pdfOpenOpts.resolution = 10;
pdfOpenOpts.suppressWarnings = true;
pdfOpenOpts.usePageNumber  = true;
// suppress dialogs;
var theDialogSettings = app.displayDialogs;
app.displayDialogs = DialogModes.NO;
pdfOpenOpts.page = x;
var thePdf = app.open(theImage, pdfOpenOpts);
thePdf.close(SaveOptions.DONOTSAVECHANGES);
// reset dialogmodes;
app.displayDialogs = theDialogSettings;
////// turn off preference to scale placed image //////
function turnOffRescale () {
// determine if the resize prefernce is on;
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var appDesc = executeActionGet(ref);
var prefDesc = appDesc.getObjectValue(charIDToTypeID( "GnrP" ));
var theResizePref = prefDesc.getBoolean(stringIDToTypeID( "resizePastePlace" ));
// turn off resize image during place;
if (theResizePref == true);{
// =======================================================
var idsetd = charIDToTypeID( "setd" );
    var desc12 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref4 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idGnrP = charIDToTypeID( "GnrP" );
        ref4.putProperty( idPrpr, idGnrP );
        var idcapp = charIDToTypeID( "capp" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref4.putEnumerated( idcapp, idOrdn, idTrgt );
    desc12.putReference( idnull, ref4 );
    var idT = charIDToTypeID( "T   " );
        var desc13 = new ActionDescriptor();
        var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
        desc13.putBoolean( idresizePastePlace, false );
    var idGnrP = charIDToTypeID( "GnrP" );
    desc12.putObject( idT, idGnrP, desc13 );
executeAction( idsetd, desc12, DialogModes.NO );
return theResizePref
////// turn on preference to scale plced image //////
function turnOnRescale (check) {
if (check == true) {
// =======================================================
var idsetd = charIDToTypeID( "setd" );
    var desc14 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref5 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idGnrP = charIDToTypeID( "GnrP" );
        ref5.putProperty( idPrpr, idGnrP );
        var idcapp = charIDToTypeID( "capp" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref5.putEnumerated( idcapp, idOrdn, idTrgt );
    desc14.putReference( idnull, ref5 );
    var idT = charIDToTypeID( "T   " );
        var desc15 = new ActionDescriptor();
        var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
        desc15.putBoolean( idresizePastePlace, true );
    var idGnrP = charIDToTypeID( "GnrP" );
    desc14.putObject( idT, idGnrP, desc15 );
executeAction( idsetd, desc14, DialogModes.NO );
////// convert to so if not one aready //////
function duplicateAndOffset (theLayer, theXOffset, theYOffset) {
app.activeDocument.activeLayer = theLayer;
// =======================================================
var idcopy = charIDToTypeID( "copy" );
    var desc9 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref5 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref5.putEnumerated( idLyr, idOrdn, idTrgt );
    desc9.putReference( idnull, ref5 );
    var idT = charIDToTypeID( "T   " );
        var desc10 = new ActionDescriptor();
        var idHrzn = charIDToTypeID( "Hrzn" );
        var idRlt = charIDToTypeID( "#Pxl" );
        desc10.putUnitDouble( idHrzn, idRlt, theXOffset );
        var idVrtc = charIDToTypeID( "Vrtc" );
        var idRlt = charIDToTypeID( "#Pxl" );
        desc10.putUnitDouble( idVrtc, idRlt, theYOffset );
    var idOfst = charIDToTypeID( "Ofst" );
    desc9.putObject( idT, idOfst, desc10 );
executeAction( idcopy, desc9, DialogModes.NO );
return app.activeDocument.activeLayer
////// load pdf as smart object //////
function transformLayer (layer, percentage, xOffset, yOffset) {
app.activeDocument.activeLayer = layer;
// =======================================================
var idTrnf = charIDToTypeID( "Trnf" );
    var desc4 = new ActionDescriptor();
    var idFTcs = charIDToTypeID( "FTcs" );
    var idQCSt = charIDToTypeID( "QCSt" );
    var idQcsa = charIDToTypeID( "Qcsa" );
    desc4.putEnumerated( idFTcs, idQCSt, idQcsa );
    var idOfst = charIDToTypeID( "Ofst" );
        var desc5 = new ActionDescriptor();
        var idHrzn = charIDToTypeID( "Hrzn" );
        var idPxl = charIDToTypeID( "#Pxl" );
        desc5.putUnitDouble( idHrzn, idPxl, xOffset );
        var idVrtc = charIDToTypeID( "Vrtc" );
        var idPxl = charIDToTypeID( "#Pxl" );
        desc5.putUnitDouble( idVrtc, idPxl, yOffset );
    var idOfst = charIDToTypeID( "Ofst" );
    desc4.putObject( idOfst, idOfst, desc5 );
    var idWdth = charIDToTypeID( "Wdth" );
    var idPrc = charIDToTypeID( "#Prc" );
    desc4.putUnitDouble( idWdth, idPrc, percentage );
    var idHght = charIDToTypeID( "Hght" );
    var idPrc = charIDToTypeID( "#Prc" );
    desc4.putUnitDouble( idHght, idPrc, percentage );
    var idLnkd = charIDToTypeID( "Lnkd" );
    desc4.putBoolean( idLnkd, true );
    var idAntA = charIDToTypeID( "AntA" );
    desc4.putBoolean( idAntA, true );
executeAction( idTrnf, desc4, DialogModes.NO );
return app.activeDocument.activeLayer
////// function to get file’s dimensions, thanks to michael l hale //////
function getDimensions( file ){
function divideString (theString) {
          theString = String(theString);
    var a = Number(theString.slice(0, theString.indexOf("\/")));
    var b = Number(theString.slice(theString.indexOf("\/") + 1));
    return (a / b)
// from a script by michael l hale;
function loadXMPLibrary(){
     if ( !ExternalObject.AdobeXMPScript ){
          try{
               ExternalObject.AdobeXMPScript = new ExternalObject
                                                            ('lib:AdobeXMPScript');
          }catch (e){
               alert( ErrStrs.XMPLIB );
               return false;
     return true;
function unloadXMPLibrary(){
   if( ExternalObject.AdobeXMPScript ) {
      try{
         ExternalObject.AdobeXMPScript.unload();
         ExternalObject.AdobeXMPScript = undefined;
      }catch (e){
         alert( ErrStrs.XMPLIB );
////// based on a script by muppet mark //////
function dimensionsShellScript (file) {
          try {
// getMetaDataMDLS;
if (File(file) instanceof File && File(file).exists) {
          var shellString = "/usr/bin/mdls ";
          shellString += File(file).fsName;
//          shellString += File(file).fullName;
          shellString += ' > ~/Documents/StdOut2.txt';
          app.system(shellString);
// read the file;
if (File('~/Documents/StdOut2.txt').exists == true) {
    var file = File('~/Documents/StdOut2.txt');
    file.open("r");
    file.encoding= 'BINARY';
    var theText = new String;
    for (var m = 0; m < file.length; m ++) {
                    theText = theText.concat(file.readch());
          file.close();
          theText = theText.split("\n");
// get the dimensions;
          var dim = new Array;
          for (var m = 0; m < theText.length; m++) {
                    var theLine = theText[m];
                    if (theLine.indexOf("kMDItemPixelWidth") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                    if (theLine.indexOf("kMDItemPixelHeight") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                    if (theLine.indexOf("kMDItemResolutionWidthDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                    if (theLine.indexOf("kMDItemResolutionHeightDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
// remove file and hand back;
          File('~/Documents/StdOut2.txt').remove();
catch (e) {
          if (File('~/Documents/StdOut2.txt').exists == true) {File('~/Documents/StdOut2.txt').remove()};
          return dim
          try{
                    loadXMPLibrary();
                    var xmpf = new XMPFile( file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ );
                    var xmp = xmpf.getXMP();
                    xmpf.closeFile();
                    var resolutionUnit = xmp.getProperty( XMPConst.NS_TIFF, 'ResolutionUnit', XMPConst.STRING);
                    var resFactor = 1;
                    if (resolutionUnit == 2) {
                              var resFactor = 1;
                    if (resolutionUnit == 3) {
                              var resFactor = 2.54;
                    var dim = [xmp.getProperty( XMPConst.NS_EXIF, 'PixelXDimension', XMPConst.STRING),
                    xmp.getProperty( XMPConst.NS_EXIF, 'PixelYDimension', XMPConst.STRING),
                    divideString (xmp.getProperty( XMPConst.NS_TIFF, 'XResolution', XMPConst.STRING)) * resFactor,
                    divideString (xmp.getProperty( XMPConst.NS_TIFF, 'YResolution', XMPConst.STRING)) * resFactor];
                    unloadXMPLibrary();
                    if(dim[0]=="undefined" || dim[1]=="undefined"){
            var dim = undefined;
            var res = undefined;
            var bt = new BridgeTalk;
            bt.target = "bridge";
            var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+file.toSource()+");");
            bt.body = myScript;
            bt.onResult = function( inBT ) {myReturnValue(inBT.body); }
            bt.send(10);
                    function myReturnValue(str){
                              res = str;
                              dim = str.split(',');
                    function psRemote(file){
                              var t= new Thumbnail(file);
                              return t.core.quickMetadata.width+','+t.core.quickMetadata.height;
    }catch(e){unloadXMPLibrary()};
          if (String(dim[2]).indexOf("\/") != -1) {
                    var a = divideString(dim[2]);
                    var b = divideString(dim[3]);
                    dim = [dim[0], dim[1], a, b]
// if dimensions are missing as might be the case with some bitmap tiffs for example try a shell-script;
          if (dim[0] == undefined || dim[1] == undefined) {
                    var array = dimensionsShellScript(file);
                    dim = array;
// if shell-string failed open doc to get measurements;
          if (dim[0] == undefined || dim[1] == undefined) {
                    var thisDoc = app.open (File(file));
// close ai without saving;
                    if (file.name.slice(-3).match(/\.(ai)$/i)) {
                              thisDoc.trim(TrimType.TRANSPARENT);
                              var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                              thisDoc.close(SaveOptions.DONOTSAVECHANGES)
                    else {
                              var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                              thisDoc.close(SaveOptions.PROMPTTOSAVECHANGES)
return dim;

Similar Messages

  • Struggling to create reports with dynamic names.... need help

    Hi everyone
    The reports that I create need to be named with dynamic content from the database. I did try to find if such an option exists in oracle portal, but alas to no avail. My report templates are going to be the same , but as the report content changes so should the report title. Does anyone has a solution to my problem
    Thanx in anticipation

    sorry ..it was silly of me ... i just found out the solution

  • How to create a 4 page pdf from images - each page should open at same size

    How do I create a 4 page pdf (from 4 images - all the same size) that opens each page at  full page size?
    Thank you so much.
    Ginger
    PREVIOUS MSG:
    My goal is to create multi page pdfs that are created from images (scans of old brochures).  I receive images (scans of pages) all at the same size.
    I have been able to create the 4 pdfs (each opens at full page size) and merge into 1 pdf.  When I open that final pdf, I  see a column of 4 pages, page 1 image being larger than the remaining 3. When I  click on the left, page 1, icon,  I get the full page.  When I click on icons for pages 2 - 4, I get nothing.  The only way I can get the other pages in a full page view is to adjust the scaling after left icon is selected.  That is not what I want.
    How I created the files.
    I can either create pdf pages using Photoshop, or using Acrobat Pro itself through:
    File> Create PDF> From File and adding each of the images.  I then, for each, choose Properties> Initial View> Fit Page> Save. Then I use File> Combine> Merge Files into Single PDF> Save.
    Then I open the multi page pdf.
    I appreciate any help.
    Thank you,
    Ginger
    PREVIOUS MS

    It seems to me what you want to do is create one document which a combination of all four  and then one page of each.
    To create a Document with 4 pages combined in to one PDF.  open the first in a Series the to Edit menu and click on add pages click on next document (browse to document first) the choose attach to to end of document or add to  end of document. Repeat until you get all images added. They will end up (or should ) center in center of their own page. Save this document with a new name for now.
    Next go back to Photo shop and reduce size of images to fit desired sheet of paper (8-1/2 by 11, 8-1/2 by 14, whatever) place them side by side and row by row so you have 4 images on one page.
    now save as Pdf.
    now decide which you want to swap to the Thumbnails (the 4 on one page, or 4 individual pages.  I would use the thumbnails and make each a button that references the page in the document you save as a 4 page pdf that applies.
    Then on that page write a line saying click each illustration to see full size image (you might have to write this line while in Photoshop) then save this as PDF file
    Try out. You might have to use some javascript controls to do this. But I am not experienced in JavaScript to do this. I'm sure it cane be done.
    But note you will have to save both documents with the Thumbnails and the four page and Thumbnail page in a folder and send to prospect
    If you want just four separate pages in one Pdf just do first two paragraphs above

  • Insert Image with full width

    Hello,
    I'm trying to insert a full-width image (like a header, or a graphic cover, footers and stuff) but no matter the size I make the image on Photoshop, it always shrinks when I insert it in Adobe Acrobat XI
    I know I can drag and make it full-width, but then I loose a lot of graphic quality in the process. Is there a way to disable the auto-resizer when adding new images?
    Thanks!

    Actually if I'm not mistaken, the pixels do matter, but the relation between pixels/size are determined by the DPI you set to the image.
    My PDF file is 110 DPI (110 pixels per inch), and the images I do in Adobe Fireworks are 110 DPI as well.
    No matter the size I do the images, they always get resized to about 70% of the page's full width.
    I'll take some screenshots of the process and post them here
    Here:
    Creating the image (21cm wide (100% of pdf's width), 3cm height.. 110 dpi)
    Adding it to the PDF trough the Tools menu bar (right side)
    The output... A image with 70% of the PDF's width, where it should be 100%
    And as you can see, the PDF's DPI is set to 110, the same as the image
    So I can only conclude that Acrobat is resizing my images, maybe to fit the margins or something, and I would like to disable that :]

  • Problem Loading an Image with javax Swing from a JApplet

    First of all, i use JCreator as java creater and have the newest version of java sdk version.
    Now i need to load an image from the harddrive on which the JApplet is located. I need to do this from inside the JApplet. I have put my pictures in a map 'images' which is located in the same directory as the classes + htm file. It works from inside JCreator, but as soon as i open the normal htm it just WON'T load that image (grmbl).
    Here is my code for loading the image:
    public BufferedImage loadImage (String filename, int transparency)
         Image image;
         if (app)
              image = Toolkit.getDefaultToolkit().getImage(("./images/"+filename));
         else
              String location = "";
              location = "./images/"+filename;
              image = Toolkit.getDefaultToolkit().getImage(location);
         MediaTracker mediaTracker = new MediaTracker(new Container());
         mediaTracker.addImage(image, 0);
         try
              mediaTracker.waitForID(0);
         catch (Exception e)
    Could anybody help me out here??
    I tried a url already using getCodeBase() or getDocumentBase() but that gives an error because it cannot find those if using a JApplet.

    Why don't you use javax.swing.ImageIcon? If you already have a flag telling if it's an application or applet, use the getDocumentBase() to base the URL in the applet part only.

  • Export PNG images with alpha channel from flash

    Hi,
    I have this FLA with animation and when played, the animation has alpha channel. I can’t understand why when I look in the library I see the frames without the alpha channel and also when I try to export/extract the image again the image don’t have alpha channel.
    How is it that in flash this image has alpha channel and how to get it out like that into PNG?
    Here is the link to download the FLA:
    http://download759.mediafire.com/nb749r29220g/e0636ab0ru6ouoa/Untitled-1.fla

    "when played, the animation has alpha channel"
    how are you playing the animation? control/enter in Flash, Publishing to a Web page or what?
    How can you tell that the animation has the alpha channel? What exactly are you seeing?
    What is the aniimation? a series of images, one image moving? Are teweens imvolved?
    " when I try to export/extract the image again the image don’t have alpha channel"
    How are you exporting the image? is it a single image? or a series of frames that makes up an animation?
    What was the file format of the original image? you brought that image into Flash and animated it? Now you want to export as a .png with transparency?
    Have you ever tried to export a  simple .png before so that you see and understand the dialog box that pops up during export? are you chosing "24 bit with alpha channel" in the "Colors" choice?
    For those of us who may not want to download your file, please provide a more detailed describtion of everything related to this question.
    Best wishes,
    Adninjastrator

  • Creating Query with dynamic columns to show results

    Hi experts,
    I need to know how to create a query with dynamic columns. Meaning, I don't want to create a query with fixed columns representing the 12 periods of the fiscal year to show me actuals as the fiscal year proceeds.
    For example, if I am currently in the middle of period 3 (March) of a fiscal year, when I execute the query, I need it to automatically only show me the 'Actuals' for periods 1 and 2, without seeing the columns from periods 3 to 12 showing blank.
    Then when I am in the middle period 5 (May) the query should ONLY show me the columns for periods 1 to 4 'Actuals', no results should be shown for periods 5 to 12 yet, and I don't want to even see blank columns for period 6 to 12.
    How do I define my columns, to achieve this.
    Maximum points will be awarded.
    Thanks Everyone.

    Hi Josh,
    I'm having a little difficuluty understanding what should be included in my restricted key figures.
    The time characteristics that I have available to use are:
    0FISCPER3 (posting period)
    0FISCYEAR (fiscal year), currently using SAP EXIT to default current fiscal year.
    0FISCVARNT (fiscal year variant).
    In addition, I have the following characteristics available to be used in the columns:
    Value type (10)
    version (currently I'm using variable for it)
    Currency type (020)
    Currency (USD).
    Can you explain what my restricted key figure should be based on and how it should look.
    I tried to create a restircted key figure using 0AMOUNT, and 0FISCPER3. For 0FISCPER3  I created a range from 1 to previous period (using SAP EXIT that supplied previous period).I also had value type, version, currency type, and currency included in that restricted key figure.Then when I tried to drag 0FISCPER3 under the restricted key figure once again, it wouldn't let me, probably because I've already used 0FISCPER3 in the restricted key figure.
    Please let me know if my explanation is not clear.
    Your step by step help would be great.
    Thanks
    Edited by: Ehab Mansour on Sep 23, 2008 2:40 PM

  • How to create table with dynamic rows

    Hi Ppl,
    I have an array lets say with length of n. I want to creata table with 2 columns and no of rows = array length.
    lets say array length is 3 ( array[0] = 1, array[1] = 2, array[2] = 3) so the table should have 2 columns and 3 rows.
    After creation of table I want to display each array value in each row.
    Can somebody help me in this asap.
    Thanks \
    Ashish

    Hi, Thanks for reply... actually this is one part of rtf. I have put values from xml to an array and now I want to create a table with no of rows = length of array. so here xml will not be useful. could you pls think of it without xml.
    result is like
    lets says below is the array
    array[0] = a
    array[1] = b
    array[2] = c
    array length = 3
    so there should be a table of 2 coulmns and 3 rows. Second column of first row will show 'a', Second column of second row wil show 'b' and Second column of third row will show 'c'.
    Hope this is useful.
    Thakns
    Ashish

  • Help with dynamic checkbox from database results

    Hi,
    I am creating some dynamic checkboxes from the results of a database read to sqlite.  I am able to get the data and the correct number of checkboxes is being created but I'm having a problem populating the labels for the checkboxes.  Here is the section of code that gets the results from the database and creates the checkboxes.
                    var result:Array = stmt.getResult().data;
                    for each( var obj:Object in result )
                        var cb:CheckBox = new CheckBox();
                        cb.label = obj.toString();
                        cb.setStyle("color", 0x00593B);
                        cb.setStyle("symbolColor", 0x000000);
                        container.contentGroup.addElement(cb);                   
    Neil

    This was answered on another forum for me.
    The line cb.label = obj.toString();
    needed to be changed to the data.
    cb.label=obj.myDatabaseFieldName;
    myDatabaseFieldName would be whatever column you are pulling the data in from and should be the actual name in the table.
    Neil

  • Need to create pdf with thumbnail pages from InDesign

    How can I create a pdf with multiple InDesign pages on each sheet (thumbnails)? I have snow leopard, cs6. Thank you.

    On a Mac, the way I like to do it is to start by generating a PDF from INDD. Open the PDF in Apple's "Preview" app. Ctrl+P. There are all sorts of options for layout — including "Pages per Sheet" under the layout option in the menu. Then, at the bottom left-hand of the print dialog box, you'll see the PDF button. After you've made your page-layout decisions, click PDF and choose your options for PDF delivery.
    In the instance documented with the attached graphics, I selected "Mail PDF." The thumbnailed PDF is created and attached to a new email.
    Maybe this helps.

  • NAM 5.1 How to create Application with port range from cli?

    Hello,
    I can create new Applicaion with port range from GUI, but I can not do it from CLI
    If I do it by CLI as a:
    nam# application
    nam# name mkst-cur-A
    nam# match udp 16001-16009
    nam# exit
    then
    nam# show application app-tag 268435576
    custom:120 (268435576) mkst-cur-A
      udp 16001
    nam#
    But if I do it by GUI and than
    nam# show application app-tag 268435576
    custom:120 (268435576) mkst-cur-A
      udp 16001 - 16009
    nam#
    How to do it by CLI?

    Hi Alexey,
    Sure, the function you're looking for is in the ANALYSIS panel under the "CUrve Fitting" palette-- it's called "Linear Mapping".  You will need to create the desired X channel prior to calling this function, though, so you will probably need to use the ANALYIS function "Generate Numeric Channel" in the "Channel Functions" palette.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • PICT file (transparent background) - motion (from off screen left to right)

    I have a PICT file with a transparent background. I imported it and put it in a track above a photo. Basically I just want to to go from off screen left to off screen right. I tried selecting the pict image, going to the motion tab and using keyframes in the ‘centre’ option to move the image off to the sides. The problem is that when I view it, its almost like every second/third line of pixels lags (Making the edges jagged).
    The edges of the image are fine when there is no motion, and it seems to get worse the more distance it is traveling.
    The only thing I have changed is the 'quick time video settings compressor'; it is ‘none’ because that is the only way I could find that wouldn’t end up messing up the sides of the image when I imported it.
    I have been using final cut for about 3 hours? So I am not sure what to do, or if I am even approaching this problem the right way. Any advice or suggestions would be greatly appreciated
    I am currently trying to find a way to get a screen shot, but can’t get it to paste into any programs I have….

    Edit: this happens when ever I do any scaling/movement/rotation/etc...
    Here is an example of what I mean:
    http://www.sfu.ca/~hpk1/Picture%201.png

  • Language switching from the scratch(left to right)

    hai experts,
    I try to the following...
    Home>>Application BuilderApplication 25718>> Shared Components >>Edit Globalization Attributes
    and
    Home>>Application BuilderApplication 25718>> Shared Components >>TranslateMappings
    but couldn't reqach the goal!
    please any one can help me how to create the language swiching the application as specially Aarbic(left to right app's),can you login and do the root plz.
    wkrspace: ram_r&d
    user name/password: aramani/apex
    http://apex.oracle.com/pls/otn/f?p=25718 Thanx,
    Ram

    we moved to followig url and Partially we reached the Requirement .
    http://apex.oracle.com/pls/otn/f?p=19248

  • Image with percent width causes Y offset

    When I set a spark or mx image to a percent width, say 30%, the image is offset from the expected / desired Y location. I have the Image in a HBox and I'm expecting it to be flush with the top but it seems to maintain the same center point as the full sized image adding padding to the top.
    Any suggestions?

    Here is a test with stage size of 640x480 and image size of 640x480:
    http://i.imgur.com/lxVk5.png
    Here is the code from the view:
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        xmlns:sc="spark.core.*"
                        width="100%"
                        height="100%"
                        actionBarVisible="false"
                        creationComplete="init()">
      <fx:Script>
                        <![CDATA[
                                  public function init():void {
                                            myBox.setStyle("backgroundColor","0xFF0000"); //red
                        ]]>
      </fx:Script>
              <mx:VBox id="myBox" verticalAlign="top" horizontalAlign="left">
      <s:Image width="30%" source="@Embed('images/smile.jpg')" />
      </mx:VBox>
    </s:View>

  • Quality concerns when creating a book in iPhoto from images in Aperture

    I use Aperture but I still like the ides of creating books in iPhoto as their styles are more suitable to, such things as, holiday photo albums than the styles offered in Aperture. The approach I use is to open iPhoto, use the 'Show Aperture Library' facility, drag and drop the images into iPhoto, and then create a book in the normal way in iPhoto.
    The concern is that the imported images into iPhoto are just small jpegs. The original in Aperture may be a 8MB RAW image whereas the imported image into iPhoto, for the purpose of book creation, may just be a 500KB jpeg. This surely must have an effect on the quality of the printed images in the book. Any views, please.

    John,
    Unless you get the little yellow exclamation mark triangle warning when you put the photo in the book. you should be ok. If not, you may have to recreate the preview for those images back in Aperture. I believe the previews are all that are used in the book. I just had a book printed through Aperture and had no problems with the default half size previews.

Maybe you are looking for

  • Operations on dimension members

    Hi Experts!! I need ideas to solve this requirement that is a bit strange; Initially I have a KPI and a dimension, which it crosses by. When I drill down on the TOTAL PROCESO, I can check the values for the members of the dimension; What I need; assi

  • Problen in price updating in sale order

    Dear All, I have maintained pricing condition based on customer Price list (KNVV-PLTYP) and price list type assigned in customer master.But I am facing two problems during updating sale order. 1.If I assign the price list in customer master(KNVV-PLTY

  • Failure with Commons GenericValidator

    Hi, I"ve got problems with the GenericValidator by Jakarta. The error message looks like that: javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: org/apache/oro/text/perl/Perl5Util      com.sun.faces.el.MethodBindingImpl.invoke(Metho

  • Error nu00BA BF00020. Iban Code

    HI. I am trying to create a new bank but I dont now how to field the iban code, it gives me the error BF00020 Thanks

  • Problem batch exporting odd sized mp4's in After Effects?

    Just been given the great task of converting hours and hours of supplied image sequences into mp4/ h.264 files for playing through silverlight. I envisaged assembling these sequences with their supplied sound tracks in after effects and outputing to