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

    How can I create a specific action / batch?

    Hi, I'm new to this forum. I have a specific issue that i cant seem to resolve...

    I have 200 tiffs in one folder (each tiff is named 'image 1-200') all without an alpha channel.
    I have 200 different tiffs in another folder (named 'luma matte 1-200').

    I've have copied the first images of the 'luma matte 1.tiff' (a black and white image) and pasted it into a newly created alpha layer in 'the image 1.tiff' channel window.

    I save this out as a new tiff called 'composite 1' and it works in the way I require it to work.

    How would I automate this process rather than having to do it individually for all the 200 files.
    I'm not sure if this can be done with a series of actions/batch?

    Any help would be greatly appreciated :-)

    NB I dont want to use After Effects luma key as this isn't giving me the correct results.

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

    Re: How can I create a specific action / batch?

    This should be close...
    Copy and paste the following script into ExtendScript Toolkit, this program is installed at the same time as Photoshop.

    Run the script and that should combine all the tiffs.

    Code:
    #target Photoshop
    app.bringToFront();
    function main(){
    var inputFolder= Folder.selectDialog ("Please select folder to process");
    if(inputFolder == null) return;
    var fileList = inputFolder.getFiles("image*.tif");
    for(var z in fileList){
    var Name = decodeURI(fileList[z].name.replace(/\.[^\.]+$/, ''));
    var  num = Name.match(/\d+$/);
    var toFind = File(inputFolder +"/"+"luma matte " + num + ".tif");
    if(!toFind.exists) continue;
    open(fileList[z]);
    open(toFind);
    activeDocument.selection.selectAll();
    activeDocument.selection.copy();
    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
    createPasteChannel();
    var saveFile = File(inputFolder+"/Composite " + num + ".tif");
    SaveTIFF(saveFile);
    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
        }
    }
    main();
    function SaveTIFF(saveFile){
    tiffSaveOptions = new TiffSaveOptions(); 
    tiffSaveOptions.embedColorProfile = true; 
    tiffSaveOptions.alphaChannels = true; 
    tiffSaveOptions.layers = true;
    tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW; 
    activeDocument.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE); 
    }
    function createPasteChannel() {
        var desc39 = new ActionDescriptor();
            var desc40 = new ActionDescriptor();
            desc40.putEnumerated( charIDToTypeID('ClrI'), charIDToTypeID('MskI'), charIDToTypeID('MskA') );
                var desc41 = new ActionDescriptor();
                desc41.putDouble( charIDToTypeID('Rd  '), 255.000000 );
                desc41.putDouble( charIDToTypeID('Grn '), 0.000000 );
                desc41.putDouble( charIDToTypeID('Bl  '), 0.000000 );
            desc40.putObject( charIDToTypeID('Clr '), charIDToTypeID('RGBC'), desc41 );
            desc40.putInteger( charIDToTypeID('Opct'), 50 );
        desc39.putObject( charIDToTypeID('Nw  '), charIDToTypeID('Chnl'), desc40 );
        executeAction( charIDToTypeID('Mk  '), desc39, DialogModes.NO );
         var desc29 = new ActionDescriptor();
        desc29.putEnumerated( charIDToTypeID('AntA'), charIDToTypeID('Annt'), charIDToTypeID('Anno') );
        executeAction( charIDToTypeID('past'), desc29, DialogModes.NO );
    };

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

    Re: How can I create a specific action / batch?

    Thanks, I'll give this a go!

 

 

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 10:41 AM.
vBulletin Skins