+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Newbie
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Batch automation problem

    Hi, I am trying to create an action that will import one image 1 (a photo) into another image 2 (a picture of a room) and place image 1 on the wall of the room like a wall picture. I need to do this for a lot of different '1' images so have tried making an action. I can do all this manually while recording the action but when I come to use it in batch process or script process the 'transform' part of image 1 which is making it smaller stalls the action with a 'Transform' is unavailable message. Anyone got any ideas....the final images are to show 'box canvas prints' on a wall above a sofa to show on a website.
    Thanks in advance

  2. #2
    The Script Master
    Join Date
    May 2009
    Location
    Bradford,UK
    Posts
    208
    Thanks
    0
    Thanked 39 Times in 34 Posts

    Re: Batch automation problem

    Picture Processor should be able to to do this.
    http://www.scriptsrus.talktalk.net/PP.htm

    Look at the part that adds a logo.

  3. #3
    Newbie
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch automation problem

    Cheers, Im on CS2 though, this is CS3 and above. No good for us poor relations Im afraid.

  4. #4
    The Script Master
    Join Date
    May 2009
    Location
    Bradford,UK
    Posts
    208
    Thanks
    0
    Thanked 39 Times in 34 Posts

    Re: Batch automation problem

    All is not lost, it just means you need to set up the following script.

    What you need to do is create a new action that does :-

    File - Place - select the picture you want placed, hit return to accept the defaul position.
    (This will be in the center)
    From the action palette fly out menu select "Insert Menu Item" then File - Scripts - select the script.

    Code:
    main();
    function main(){
    if(!documents.length) return;
    if (activeDocument.activeLayer.kind != LayerKind.SMARTOBJECT) return;
    /////////////////////////////// Amend to suit /////////////////////////////////
    var Percent = 25; /* Resize logo to percentage of smallest side of doc */
    var OffsetX = 0; /* Move logo pixels to the right - left */
    var OffsetY = 20; /* Move  logo pixels up - down. */
    var Opacity = 100; /* Opacity of logo */
    /////////////////////////////////////////////////////////////////////////////////////////////
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var myDoc = activeDocument;
    rasterLayer();
    var LB = myDoc.activeLayer.bounds; 
    var docHeight = myDoc.height;
    var docWidth = myDoc.width;
    var LHeight = Math.abs(LB[3].value) - Math.abs(LB[1].value);
    var LWidth = Math.abs(LB[2].value) - Math.abs(LB[0].value);    
    var percentageHeight = ((docHeight/LWidth)*Percent); 
    var percentageWidth = ((docWidth/LWidth)*Percent);
    if(docWidth < docHeight){
    myDoc.activeLayer.resize(percentageWidth,percentageWidth,AnchorPosition.MIDDLECENTER);
    }else{   
      myDoc.activeLayer.resize(percentageHeight,percentageHeight,AnchorPosition.MIDDLECENTER);
      }
    activeDocument.selection.selectAll();
       // align methods
       // 'AdCH' - center horizontal 
       // 'AdCV' - center vertical 
       // 'AdLf' - left 
       //  'AdRg' - Right
       // 'AdBt' - bottom 
       //  'AdTp' - Top
    align('AdCH');
    align('AdTp');
    activeDocument.selection.deselect();
    activeDocument.activeLayer.translate(OffsetX,OffsetY);
    activeDocument.activeLayer.opacity=Opacity;
    app.preferences.rulerUnits = startRulerUnits;
    }
    function align(method){ 
       var desc = new ActionDescriptor();
               var ref = new ActionReference();
               ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) ); 
           desc.putReference( charIDToTypeID( "null" ), ref ); 
           desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );
       executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO ); 
    };
    function rasterLayer() {
        var desc9 = new ActionDescriptor();
            var ref4 = new ActionReference();
            ref4.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc9.putReference( charIDToTypeID('null'), ref4 );
        executeAction( stringIDToTypeID('rasterizeLayer'), desc9, DialogModes.NO );
    };
    Copy and paste the code into ExtendScript Toolkit.
    This utility can be found:-
    PC: C:\Program Files\Adobe\Adobe Utilities
    MAC: <hard drive>/Applications/Utilities/Adobe Utilities
    Save the script to the following folder:-
    PC: C:\Program Files\Adobe\Adobe Photoshop CS2\Presets\Scripts

    MAC: <hard drive>/Applications/Adobe Photoshop CS2/Presets/Scripts
    N.B. if your are using Vista or Windows 7 you will need to save the script elsewhere and then copy it to the relevant folder, this is due to permissions.
    If Photoshop was open close and restart it so that it can pick up the new script.

    You will need to amend the script so that the log/picture is the correct size and positioned as you wish.

    Hope this helps.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Powered by vBulletin® Version 4.1.9
Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO 3.6.0
Copyright 2011 Photoshop Gurus Forum. All rights reserved.
All times are GMT -5. The time now is 09:17 AM.
vBulletin Skins