Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all 12244 articles
Browse latest View live

Scale Photoshop layer using AppleScript

$
0
0

Obviously, this is a Mac PS issue.

 

I am trying to script scaling a Photoshop layer (a smart object layer) to a specified percentage that I calculate from a layout in InDesign.

However, I am stumped on the syntax I should use to actually get the layer to resize, or perhaps I don't know how to call out the layer properly.

 

Here is my code (it is very simple at this point in time:

 

 

tell application "Adobe InDesign CS6"          set mySelect to selection  --error trap to make sure I have graphic content selected            tell active spread of active window                    set thisBox to item 1 of mySelect                    set HScale to the absolute horizontal scale of thisBox            end tell
end tell
myScaleConversion(HScale)
set PSScaled to result as real

tell application "Adobe Photoshop CS6"
          set thisLayer to current layer of current document          set scaleSet to {horizontal scale:PSScaled, vertical scale:PSScaled, anchor:"top left"}  scale current layer of current document with scaleSet  
end tell


on myScaleConversion(HScale)
          set ScaleRatio to 2.5 as real          set PSScale to (ScaleRatio * HScale)          return PSScale  
end myScaleConversion

 

 

I would appreciate any help with this. I run this script and no error messages occur, but then again, nothing happens to the Photoshop layer I have targeted.


Create Layer with BG Color

$
0
0

function layer() {

Application.activeDocument

Application.backgroundColor (blue = 34, green = 12, red = 1)

 

}

layer()

 

 

I want to create a NewLayer, with a specific background color, the code above is not working.

export all files using saveAsWeb & device

$
0
0

Hi Forum..

 

New to scripting. please help.

 

 

I have this little bit, which is converting only the active document (single file) as ExportOptionsSaveForWeb().

 

I wish to export all the activeDocument using ExportOptionsSaveForWeb(). Here only one document is done and all the others is closed without converting...

 

function main(){

if(documents.length!=0)

var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');

var saveFile = File(Folder("/Users/wleastudio/Desktop/untitled folder")  + "/" +  Name + ".jpg");

if(saveFile.exists){

   if(!confirm("Overwrite existing document?")) return;

    saveFile.remove();

    }

SaveForWeb(saveFile,60); //change to 60 for 60%

}

main();

function SaveForWeb(saveFile,jpegQuality) {

var sfwOptions = new ExportOptionsSaveForWeb();

   sfwOptions.format = SaveDocumentType.JPEG;

   sfwOptions.includeProfile = false;

      sfwOptions.convertProfile = false;

   sfwOptions.interlaced = 0;

   sfwOptions.optimized = true;

   sfwOptions.quality = 60;

   sfwOptions.compression = 60; //0-100

activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

}

 

 

while(app.documents.length > 0)

     {

     app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

     }

VBscript Photoshop: convert active document to RGB (PsChangeMode?)

$
0
0

Hi there

I'm trying to convert the color mode of my active document to RGB, IF it needs doing. I'm struggling with the line, I'm a novice with VBscript. I'm trying something like

 

docRef.PsChangeMode = 2

 

But the PsChangeMode generates the error Object doesn't support this property or method. Please can anyone give me some pointers?

Thank you

David

Snap with scripting

$
0
0

Is it possible to switch the snap (VIew --> Snap) on and off using scripting? Something along the lines of

 

 

app.activeDocument.snap = true;

 

Cheers

Is it possible to generate a text file with layer names, blend modes etc

$
0
0

I have some very large PSDs. 2gb and above, maybe a dozen layers each. I need to manually, generate a list:

 

Filename

Image size in pixels and inches

Layer names ( I need to know what assets are used in the file)

Layer blend modes and percentages.

 

I was wondering if that is somehow stored in plain text in the meta data of the file and could be scripted out, to the clipboard or a text file log?

 

I have 96 files to do, and copying out layer names is pretty slow.

 

Thanks

 

Max

Reserved words

$
0
0

I just discovered that "name" is a reserved word. Or at least if you create a variable called name it'll ignore it.

 

alert(name)

 

Adobe Photoshop

 

Is there a list reserved words in photoshop scripting somewhere so I can avoid them?

Cheers

ExtendToolscript opens when I call script from photoshop

$
0
0

Hey,

 

 

I asked this question over in general discussions by mistake so I though I would re-ask it here.

 

I have a Javascript that I have written that builds a interface of buttons in organised groups based on the contents of certain folders. Everything works fine but when you call it from photoshop and extendtoolscript isn't running it always opens it up. I have written a lot of scripts with interfaces and I have never had this problem. Its not a huge problem for me as I usually have this program open anyway but I intend to have a team of people using this script so if I could stop it somehow it would be much better.

 

Has anyone experienced this before? Or perhaps knows of functions that cause extendscript to open?

 

I can't see anything unusual in the script...

 

Any help would be appreciated!

 

Thanks,

 

Mark

 

 

 

 

var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;    
var templatepath = "~/Desktop/BANNERS/";  
var bannerfile = ""
var docRef = app.activeDocument;    
var fileArray = new Array();                  var sourceFolder = Folder (templatepath + "MAIN/");                  var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;                                // get all files in source folder                var docs = sourceFolder.getFiles();                var len = docs.length;                for (var i = 0; i < len; i++) {                                var doc = docs[i];                                  // only match files (not folders)                                if (doc instanceof File) {                                                // store all recognized files into an array                                                var docName = doc.name;                                                if (docName.match(extRE)) {                                                                fileArray.push(doc);                                                }                                }                }                                    var w = new Window ("dialog", "Choose a Banner");            w.preferredSize = [400, 100];            w.orientation = 'row';            w.alignChildren = "left"            w.alignChildren = [ "fill", "fill"];                        w.btnPnl = w.add('panel', undefined, 'MAIN');                        w.btnPnl.btn = w.add ("group");            w.btnPnl.btn.alignChildren = "left"                        var buttonarray = new Array ();            var key = {};                                                for (var i = 0; i < fileArray.length ; i++) {                                var delimeter = '/';                var string = String (fileArray[i]);                var splitted = string.split(delimeter);                var thelength = ((splitted.length) - 1);                var bannername = splitted[thelength];                var delimeter = '.';                var splitted = bannername.split(delimeter);                var bannername = splitted[0];                                                var checkdelim = "%20";                var checkthat =  bannername.indexOf(checkdelim);                if (checkthat == "-1") {}                else{                                    var delimeter = '%20';                var splitted = bannername.split(delimeter);                var counter = 0;                while (counter < splitted.length){                                if (counter == 0){                var bannername = (splitted[counter] + " ");                    }                elseif (counter == ((splitted.length) - 1)){                var bannername = (bannername + splitted[counter]);                }                else{                var bannername = (bannername + splitted[counter] + " ");                }                var counter = (counter + 1);                }                            }            if (fileArray.length > 6){                    var divider = 2                    }                else{                    var divider = 1                    }                                var remainder = (i % divider);                if (remainder == 0){                  w.btnPnl.btn = w.btnPnl.add ("group");                w.btnPnl.btn.alignChildren = "left"                }else{                //x is not a multiple of y                }                                key = (String (fileArray[i]));                w[key] = w.btnPnl.btn.add("button", undefined ,bannername );                 w[key].alignment = 'left';                buttonarray.push(w[key]);                                w.btnPnl.btn.addEventListener('click', button_pressed);                                function button_pressed (e)                {               if (e.target.type == "button")                $.writeln (e.target.text + " from panel " + e.target.parent.text);                w.close()                ////////////////////                var buttonname = e.target.text;                var checkdelim = " ";                var checkthat = buttonname.indexOf(checkdelim);                if (checkthat == "-1") {}                else{                                    var delimeter = ' ';                var splitted = buttonname.split(delimeter);                var counter = 0;                while (counter < splitted.length){                                if (counter == 0){                var buttonname = (splitted[counter] + "%20");                    }                elseif (counter == ((splitted.length) - 1)){                var buttonname = (buttonname + splitted[counter]);                }                else{                var buttonname = (buttonname + splitted[counter] + "%20");                }                var counter = (counter + 1);                }            }                            ///////////////////////                                bannerfile = new File (templatepath + "MAIN/" + buttonname + '.png');                                 }             }         ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
var fileArrayneon = new Array();                  var sourceFolder = Folder (templatepath + "NEON/");                  var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;                                // get all files in source folder                var docs = sourceFolder.getFiles();                var len = docs.length;                for (var i = 0; i < len; i++) {                                var doc = docs[i];                                  // only match files (not folders)                                if (doc instanceof File) {                                                // store all recognized files into an array                                                var docName = doc.name;                                                if (docName.match(extRE)) {                                                                fileArrayneon.push(doc);                                                }                                }                }                                                            w.btnPnl = w.add('panel', undefined, 'NEON');                        w.btnPnl.btn = w.add ("group");                        var buttonarray = new Array ();            var key = {};                                                for (var i = 0; i < fileArrayneon.length ; i++) {                                var delimeter = '/';                var string = String (fileArrayneon[i]);                var splitted = string.split(delimeter);                var thelength = ((splitted.length) - 1);                var bannername = splitted[thelength];                var delimeter = '.';                var splitted = bannername.split(delimeter);                var bannername = splitted[0];                                                var checkdelim = "%20";                var checkthat =  bannername.indexOf(checkdelim);                if (checkthat == "-1") {}                else{                                    var delimeter = '%20';                var splitted = bannername.split(delimeter);                var counter = 0;                while (counter < splitted.length){                                if (counter == 0){                var bannername = (splitted[counter] + " ");                    }                elseif (counter == ((splitted.length) - 1)){                var bannername = (bannername + splitted[counter]);                }                else{                var bannername = (bannername + splitted[counter] + " ");                }                var counter = (counter + 1);                }                            }                        if (fileArrayneon.length > 6){                    var divider = 2                    }                else{                    var divider = 1                    }                                var remainder = (i % divider);                if (remainder == 0){                  w.btnPnl.btn = w.btnPnl.add ("group");                w.btnPnl.btn.alignChildren = "left"                }else{                //x is not a multiple of y                }                                key = (String (fileArrayneon[i]));                w[key] = w.btnPnl.btn.add("button", undefined ,bannername );                 w[key].alignment = 'left';                buttonarray.push(w[key]);                                w.btnPnl.btn.addEventListener('click', button_pressed);                                function button_pressed (e)                {               if (e.target.type == "button")                $.writeln (e.target.text + " from panel " + e.target.parent.text);                w.close()                ////////////////////                var buttonname = e.target.text;                var checkdelim = " ";                var checkthat = buttonname.indexOf(checkdelim);                if (checkthat == "-1") {}                else{                                    var delimeter = ' ';                var splitted = buttonname.split(delimeter);                var counter = 0;                while (counter < splitted.length){                                if (counter == 0){                var buttonname = (splitted[counter] + "%20");                    }                elseif (counter == ((splitted.length) - 1)){                var buttonname = (buttonname + splitted[counter]);                }                else{                var buttonname = (buttonname + splitted[counter] + "%20");                }                var counter = (counter + 1);                }            }                            ///////////////////////                                bannerfile = new File (templatepath + "NEON/" + buttonname + '.png');                                 }             }  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////
var fileArray180 = new Array();                  var sourceFolder = Folder (templatepath + "180/");                  var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;                                // get all files in source folder                var docs = sourceFolder.getFiles();                var len = docs.length;                for (var i = 0; i < len; i++) {                                var doc = docs[i];                                  // only match files (not folders)                                if (doc instanceof File) {                                                // store all recognized files into an array                                                var docName = doc.name;                                                if (docName.match(extRE)) {                                                                fileArray180.push(doc);                                                }                                }                }                                                            w.btnPnl = w.add('panel', undefined, '180');                        w.btnPnl.btn = w.add ("group");                        var buttonarray = new Array ();            var key = {};                                                for (var i = 0; i < fileArray180.length ; i++) {                                var delimeter = '/';                var string = String (fileArray180[i]);                var splitted = string.split(delimeter);                var thelength = ((splitted.length) - 1);                var bannername = splitted[thelength];                var delimeter = '.';                var splitted = bannername.split(delimeter);                var bannername = splitted[0];                                                var checkdelim = "%20";                var checkthat =  bannername.indexOf(checkdelim);                if (checkthat == "-1") {}                else{                                    var delimeter = '%20';                var splitted = bannername.split(delimeter);                var counter = 0;                while (counter < splitted.length){                                if (counter == 0){                var bannername = (splitted[counter] + " ");                    }                elseif (counter == ((splitted.length) - 1)){                var bannername = (bannername + splitted[counter]);                }                else{                var bannername = (bannername + splitted[counter] + " ");                }                var counter = (counter + 1);                }                            }                                   if (fileArray180.length > 6){                    var divider = 2                    }                else{                    var divider = 1                    }                                var remainder = (i % divider);                                                if (remainder == 0){                  w.btnPnl.btn = w.btnPnl.add ("group");                w.btnPnl.btn.alignChildren = "left"                }else{                //x is not a multiple of y                }                                key = (String (fileArray180[i]));                w[key] = w.btnPnl.btn.add("button", undefined ,bannername );                 w[key].alignment = 'left';                buttonarray.push(w[key]);                                w.btnPnl.btn.addEventListener('click', button_pressed);                                function button_pressed (e)                {               if (e.target.type == "button")                $.writeln (e.target.text + " from panel " + e.target.parent.text);                w.close()                ////////////////////                var buttonname = e.target.text;                var checkdelim = " ";                var checkthat = buttonname.indexOf(checkdelim);                if (checkthat == "-1") {}                else{                                    var delimeter = ' ';                var splitted = buttonname.split(delimeter);                var counter = 0;                while (counter < splitted.length){                                if (counter == 0){                var buttonname = (splitted[counter] + "%20");                    }                elseif (counter == ((splitted.length) - 1)){                var buttonname = (buttonname + splitted[counter]);                }                else{                var buttonname = (buttonname + splitted[counter] + "%20");                }                var counter = (counter + 1);                }            }                            ///////////////////////                                bannerfile = new File (templatepath + "180/" + buttonname + '.png');                                 }             }        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
var fileArraymisc = new Array();                  var sourceFolder = Folder (templatepath + "MISC/");                  var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;                                // get all files in source folder                var docs = sourceFolder.getFiles();                var len = docs.length;                for (var i = 0; i < len; i++) {                                var doc = docs[i];                                  // only match files (not folders)                                if (doc instanceof File) {                                                // store all recognized files into an array                                                var docName = doc.name;                                                if (docName.match(extRE)) {                                                                fileArraymisc.push(doc);                                                }                                }                }                                                            w.btnPnl = w.add('panel', undefined, 'MISC');                        w.btnPnl.btn = w.add ("group");                        var buttonarray = new Array ();            var key = {};                                                for (var i = 0; i < fileArraymisc.length ; i++) {                                var delimeter = '/';                var string = String (fileArraymisc[i]);                var splitted = string.split(delimeter);                var thelength = ((splitted.length) - 1);                var bannername = splitted[thelength];                var delimeter = '.';                var splitted = bannername.split(delimeter);                var bannername = splitted[0];                                                var checkdelim = "%20";                var checkthat =  bannername.indexOf(checkdelim);                if (checkthat == "-1") {}                else{                                    var delimeter = '%20';                var splitted = bannername.split(delimeter);                var counter = 0;                while (counter < splitted.length){                                if (counter == 0){                var bannername = (splitted[counter] + " ");                    }                elseif (counter == ((splitted.length) - 1)){                var bannername = (bannername + splitted[counter]);                }                else{                var bannername = (bannername + splitted[counter] + " ");                }                var counter = (counter + 1);                }                            }                if (fileArraymisc.length > 6){                    var divider = 2                    }                else{                    var divider = 1                    }                                var remainder = (i % divider);                if (remainder == 0){                  w.btnPnl.btn = w.btnPnl.add ("group");                w.btnPnl.btn.alignChildren = "left"                }else{                //x is not a multiple of y                }                                key = (String (fileArraymisc[i]));                w[key] = w.btnPnl.btn.add("button", undefined ,bannername );                 w[key].alignment = 'left';                buttonarray.push(w[key]);                                w.btnPnl.btn.addEventListener('click', button_pressed);                                function button_pressed (e)                {               if (e.target.type == "button")                $.writeln (e.target.text + " from panel " + e.target.parent.text);                w.close()                ////////////////////                var buttonname = e.target.text;                var checkdelim = " ";                var checkthat = buttonname.indexOf(checkdelim);                if (checkthat == "-1") {}                else{                                    var delimeter = ' ';                var splitted = buttonname.split(delimeter);                var counter = 0;                while (counter < splitted.length){                                if (counter == 0){                var buttonname = (splitted[counter] + "%20");                    }                elseif (counter == ((splitted.length) - 1)){                var buttonname = (buttonname + splitted[counter]);                }                else{                var buttonname = (buttonname + splitted[counter] + "%20");                }                var counter = (counter + 1);                }            }                            ///////////////////////                                bannerfile = new File (templatepath + "MISC/" + buttonname + '.png');                                 }             }                           
 w.show();          ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (bannerfile == ""){}else{ 
var targetDocumentName =  docRef.name;
var tempfile = app.open (bannerfile);
var sourceDocumentName = app.activeDocument.name;    
var thewidth = tempfile.width;
var theheight  = tempfile.height;    
app.activeDocument = docRef;
docRef.resizeImage (null, theheight, null, ResampleMethod.BICUBIC);  if ((String(thewidth)) == (String(docRef.width))){
var thelayer = docRef.activeLayer;
copyLayers(sourceDocumentName, targetDocumentName );
docRef.activeLayer = thelayer;}else{
alert ("Document width Incorrect")     
docRef.activeLayer.name = "main";
var thelayer = docRef.activeLayer;
docRef.resizeCanvas (thewidth, null, AnchorPosition.BOTTOMCENTER);
copyLayers(sourceDocumentName, targetDocumentName );
docRef.activeLayer = thelayer;}  imageView ("FtOn");}           ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    
 function copyLayers(sourceDocumentName, targetDocumentName) {  var sourceDoc = app.documents[sourceDocumentName];  var targetDoc = app.documents[targetDocumentName];  var sourceLayer, targetLayer, sourceGroup;    if (app.activeDocument != sourceDoc) {    app.activeDocument = sourceDoc;  }  
var thelayer = tempfile.layers[0];
var layersToCopy = thelayer.name;    if ( typeof layersToCopy === 'string' ) {    sourceGroup = tempfile.layers[0];    targetLayer = sourceGroup.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING )  }  elseif ( Object.prototype.toString.call( layersToCopy ) === '[object Array]' ) {    for (var i = 0; i < layersToCopy.length; i++) {      sourceLayer = sourceDoc.artLayers.getByName( layersToCopy[i] );      targetLayer = sourceLayer.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING );    }  }
tempfile.close(SaveOptions.DONOTSAVECHANGES);}      
function imageView (view) {    desc= new ActionDescriptor();        ref = new ActionReference();      if (view.length < 5){         var viewID = charIDToTypeID( view );      }else{         var viewID = stringIDToTypeID( view );      }      ref.putEnumerated( charIDToTypeID( "Mn  " ), charIDToTypeID( "MnIt" ), viewID );    desc.putReference( charIDToTypeID( "null" ), ref );   executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );}

8x12 Contact Sheet with one sigle image in various format

$
0
0

Hello Sir,

 

 

I would to understand how I can realise a 8x12 contact sheet displaying the same image in various formats ?

 

 

It is commonly used in school photography.

 

 

One image would be 13x18cm, 2 others 6x9cm, and the 6 thumbnails showing the same portrait.

 

 

I am a european photographer so I do not know perfectly the corresponding sizes, should be :

 

1x   5x7

2x   2x3.5

 

 

I do not get the methodology.

 

I can show you some various examples... such as this one !

 

http://www.photomathieu.com/

 

 

Thanks for your help ! Urgent !!

Resize Canvas applescript using the relative tick?

$
0
0

I'm using this

 

tellapplication "Adobe Photoshop CS6"

  resize canvasheight -1 anchor positiontop center

endtell

 

I want to reduce the size of the image by 1 pixels from the top center. But when I do it manually I would use the "relative" check box,

 

How can I do this?

 

please

Detect if top line of a layer is empty or not?

$
0
0

I'm trying to work out how the top line of an image layer is transparent or not? I need to know if it contains visable pixels so that i instruct the crop correctly.

 

Ideally in applescript as I understand this. otherwise usual script is fine too.

 

Many Thanks

 

Matt

How to batch generate hundreds of color swatches?

$
0
0

- i need to get hundreds of color swatech in tiff (Lab color) format.
- i have table with name of color and its Lab values (columns: name; L value; a value; b value) - table i can save as .csv etc.; script can ask for path to .csv file or can be fixed path and filename
- tiff document can be e.g. 10x10 px or 100x100 px.
- tiff file should be naming according to table value (column "name")
- files can by saved e.g. on disc C: (or user can be ask at the start of the batch)

 

I am not programmer and I will be thankful if somebody write this script (JavaScript).
I think that it will be useful for many graphic designers.

 

(Sorry for my English)

Open Folder

$
0
0

I have a folder on the C drive called "Container". Since I often have to open pictures from a camera and Windows always remembers the last task I can not write an action which always opens this particular folder.

Can a Script be written that always will open this folder regardless what was opened before?

CS5: Macro for HDR toning.. Bug?

$
0
0

Hey,

 

I got over 5000 picture files to add the "hdr effect" with hdr toning of Photoshop CS5. I recorded a macro where i do it with the "Surrealistic" - preset and also tried custom settings. But every time i run the macro it just opens the HDR toning script and i have to manually set the settings and press OK...

In the action it says "File: d:/programs/adobe/photoshop cs5/required/hdr toning.jsx" or something like that.

 

So how i can make photoshop automatically apply the hdr toning to thousands of pictures?

Save As in Parent Directory

$
0
0

I am trying to create an process and action that does the following:

 

  1. Process outside of PS that stages files for edit
  2. PS Action to set selection(s) (each selection is on its own channel) on the original tif
  3. PS Action to open Background template file (.bmp file)
  4. PS Action to paste selection(s) in place (from channels) into .bmp file
  5. PS Action to flatten document
  6. PS Action to Save As a .bmp using the current file name one directory up
  7. Process outside of PS that cleans up and moves files

 

I am good on steps 1 through 5 and 7, but cannot figure out step 6 in a Win7 environment.  Basically, I edit images in a staging folder before moving them to the parent.  Then the parent folder is cleaned up and pulled into a permanent storage location.  So the workspace looks like this:

 

 

Starting file structure (three .bmp files and two subfolders in ...\parent)

 

...\parent\File1.bmp  {old}

...\parent\File2.bmp

...\parent\File3.bmp

...\parent\Delete\

...\parent\Working\

 

Next step:  New File1.tif is sourced and placed in Working Folder, Current File1 is moved to Delete Folder

 

...\parent\File2.bmp

...\parent\File3.bmp

...\parent\Delete\File1.bmp  {old}

...\parent\Working\File1.tif

 

Next step:  Edit File1.tif in Working Folder and run final action - Save As .bmp in one folder up (...\parent\)

 

...\parent\File1.bmp  {new}

...\parent\File2.bmp

...\parent\File3.bmp

...\parent\Delete\File1.bmp  {old}

...\parent\Working\File1.tif

 

Last step, Cleanup:  Remove the Delete/Working subfolders, move files to new location

 

...\parent\File1.bmp  {new}

...\parent\File2.bmp

...\parent\File3.bmp

 

 

 

How can I do the Save As step??


Error 2: SAVE_FOLDER is undefined. Line: 361 ->

$
0
0
  1. Hi.

 

Every time I try to run a script it comes up with the following message

 

Error 2: SAVE_FOLDER is undefined. Line: 361 ->

 

I've tried uninstalling and reinstalling photoshop/deleting the script from all sources/reinstalling the script/reset photoshop settings by pressing shift+control+alt whilst starting photoshop... but none of these work.

 

The script that I am trying to run is a free Facebook Photo Optimiser by Code&Hustle. They haven't returned my queries. I run the script on other identical computers so I know it is nothing to do with the script.

 

I don't know how to find the 'code' for the script, so if anyone needs that to help then please let me know how to find it!

 

If anyone can help it it would be so much appreciated as this is really frustrating and I'm completely stuck!

 

Thank you.

cs6 Exr saving issue.

$
0
0

Hey everyone, I'm trying to update a portion of my .jsx code that worked in CS5, and now doesn't work in CS6.. EXR format is now included in CS6, and handles the alpha channel differently, basically it recognizes it now, as it didn't before as many  of you know.

 

So I am using the script listener to try and create a simple variable to pass on at save time, and I'm having problems with it saving the .exr when I try to pass the variable for the file path through... for instance, if I run this code on a file with an alpha channel, (it has to be 32 bit or it will error out):

 

function saveEXR(archiveFile) {

    var idsave = charIDToTypeID( "save" );

    var desc14 = new ActionDescriptor();

    var idAs = charIDToTypeID( "As  " );

    desc14.putString( idAs, """OpenEXR""" );

    var idIn = charIDToTypeID( "In  " );

    desc14.putPath( idIn, new File( "L:\TF_testFile\TF_testFile_red_a_v01.exr" ) );

    var idDocI = charIDToTypeID( "DocI" );

    desc14.putInteger( idDocI, 84 );

    var idCpy = charIDToTypeID( "Cpy " );

    desc14.putBoolean( idCpy, true );

    var idsaveStage = stringIDToTypeID( "saveStage" );

    var idsaveStageType = stringIDToTypeID( "saveStageType" );

    var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );

    desc14.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );

    executeAction( idsave, desc14, DialogModes.NO );

}

saveEXR()

 

Then it works just fine, the problem is passing a dynamic path/name through the save function. So if I swap a couple lines, for instance:

 

function saveEXR(archiveFile) {  

    var idsave = charIDToTypeID( "save" );

    var desc14 = new ActionDescriptor();

    var idAs = charIDToTypeID( "As  " );

    desc14.putString( idAs, """OpenEXR""" );

    var idIn = charIDToTypeID( "In  " );

    desc14.putPath( idIn, archiveFile);

    var idDocI = charIDToTypeID( "DocI" );

    desc14.putInteger( idDocI, 84 );

    var idCpy = charIDToTypeID( "Cpy " );

    desc14.putBoolean( idCpy, true );

    var idsaveStage = stringIDToTypeID( "saveStage" );

    var idsaveStageType = stringIDToTypeID( "saveStageType" );

    var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );

    desc14.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );

    executeAction( idsave, desc14, DialogModes.YES );


}

saveEXR(archiveFile)

 

Then it doesn't work. Also, it will error saying it was unable to write the file. I checked, and it IS in fact passing the file into the correct directory and naming it properly, but it's not including the alpha channel at all. Soooooooo if anyone has any sort of clue what may be happening here, or if this sounds like a bug... I'd appreciate it. I'm stuck. :(


applescript, CS5 to CS6, files won't close

$
0
0

This is the part of my script, that runs from with photoshop. on CS5 it opened and closed everything without a problem, however in CS6 it processes the images but does not close them.

 

Can anyone see where it might be going wrong?

Let me know if you need the whole thing and I'll condense it down.

 

Many Thanks

Matt

 

tellcurrent document

 

 

  --If the quick mask mode has been left on then delete the channel Quick Mask

                                                                                if (quick mask mode) thendeletechannel¬

                                                                                          "Quick Mask"

  --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image

                                                                                if (existslayer "Original Layer") then¬

                                                                                          telllayer "Original Layer" tosetnameto "Original Image"

  savein (localBrandFolder_PSD& origName) asPhotoshop formatwith optionsmyPSDOptionswithoutcopying

                                                                                (deletelayer "Original Image") flatten

 

  resize imageresolution 300 resample methodnone

 

  --sharpen image

  filtercurrent layerusingunsharp maskwith options {amount:80, radius:3.2, threshold:0}

 

  savein (ftpBrandFolder_High_Res& name) asJPEGwith optionsmyOptionswithoutcopying

 

  --Prepare for Low RES by resetting image history

                                                                                setcurrent history statetohistory state 3

 

                                                                                flatten

 

                                                                                resize imagewidth 1348

  resize imageresolution 300 resample methodnone

  filtercurrent layerusingunsharp maskwith options {amount:80, radius:3.2, threshold:0}

 

  --add save to lowResFolder with same options

  savein (networkBrandFolder_Low_Res& name) asJPEGwith optionsmyOptionswithoutcopying

 

                                                                                setnewFiletofile path

                                                                                setnewFile2tonewFileasstring-- for testing end of name

                                                                                ifnewFile2ends with "_2.jpg" ornewFile2ends with "_3.jpg" ornewFile2ends with "_4.jpg" ornewFile2ends with "_5.jpg" ornewFile2ends with "_6.jpg" ornewFile2ends with "_7.jpg" ornewFile2ends with "_8.jpg" ornewFile2ends with "_9.jpg" ornewFile2ends with "_10.jpg" ornewFile2ends with "11.jpg" then-- exclude website_images

                                                                                          myduplicateFile(newFile, {ftpBrandFolder_Low_Res})

                                                                                else

                                                                                          myduplicateFile(newFile, {ftpBrandFolder_Low_Res, website_images})

                                                                                endif

 

  closesavingno

 

  display dialog "A"

                                                                                return

                                                                      endtell

                                                            onerror

                                                                      setnoErrortofalse

                                                                      mymyLogs(thefile) -- write path to log file in Desktop

                                                                      try

  closesavingno--if exists, close current document

  display dialog "B"

                                                                                return

                                                                      endtry


Is there any event listener for changing the selection of layer?

$
0
0

Hi all,

 

I am looking into an event listener which fires on changing the selection of layer. I found 'Select' event listener which fires on selecting the different object.

 

Actually the problem with Select event listener is that when we select an object and move it and deselect it by clicking on the document, event fires on the selection of that object. But if we again select the same object and move it, no event is fired at that time.

 

Is there any workaround of this? So that the event is fired every time when we select the same object.

 

Please help me on this..

 

Regards,

VG.

Getting Channel Information

$
0
0

Ok, I'm trying to write a script that copies spot color channels directly into Layers.  I know how to copy the information over, and I figured out how to get the name to transfer, but I'm hung up right now trying to color overlay the new layer with the spot color of the old channel.

 

 

 

How do I grab that spot color as a variable that I can later call out in a color overlay?

Viewing all 12244 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>