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

Export layers to file script error in Photoshop CC

$
0
0

I need help with an issue.  I also asked this in the general forum but was refered here to ask all of you amazingly talented scripting geniuses.

 

My issue is with the Export Layers script that comes installed with Photoshop.  I am running Windows 7 64bit - using photoshop version: creative cloud 64bit.

 

When i try to run File>Scripts> Export Layers to files I get this error

Error 22: Windows does not have a constructor. Line: 239 -> dlgMain = new Window ("dialog", strTitle); 

When i load Photoshop Creative Cloud 32 bit i get a different error message when trying to run the script. 

Error - 33: Internal error . line:395 ->  dligMain.pnlFileType.pnlOptions.grpJPGOptions = ...

 

I can't run the image processor script I also get an error with that. 

 

This  is an issue for me as i use this script on a daily basis.  It worked in PSCS6  

I upgraded, i dont' want to have to load an older  version of photoshop to do this task  

 

Thanks

Carrie 


Photoshop javascript: Open files in all subfolders

$
0
0

Hi guys

 

I'm very new to javascript, and general Photoshop scripting. My script is coming on well, but I struggle working with files and folders. It's a lack of basic javascript knowledge, which I need to work on. Right now, I'm trying to expand the image open part of my script, so that it opens images regardless of whether they are in a subfolder or not.

 

You can see my input folder (C:/Input). I want to be able to throw files in there, some in folders, some not. Out of interest, my outputs will be combined into one output folder... that bit is fine.

 

 

var inFolder = new Folder("C:/Input")

if(inFolder != null){

var fileList = inFolder.getFiles(/\.(jpg|tif|psd|bmp|gif|png|)$/i);

}

for(var a = 0 ;a < fileList.length; a++)

{

var docRef = open(fileList[a]);

//do things here

}

 

Is there an easy way of expanding this to include files in subfolders? All advice greatly appreciated.

Thanks

David

Photoshop CS and script folder location

$
0
0

Hello Community,

I had a look around but can't find my solution.

 

I recently upgraded my Apple OS from 10.6 to 10.9. I was using Photoshop CS for my small needs as my main RAW covnerter is Capture One and have upgraded to CS4.

I forgot to export the actions (scripts) that I had done.

 

I can't seem to locate them in the CS folder on the app folder and in the library.

Anyone has a solution ?

 

Thanks in advance for oyur help and Best Wishes for the New Year.

 

Denis

Will KillWhite run on Photoshop CS6 64-bit?

$
0
0

So - now that I am in need of what looks like just the most perfect and amazing solution... am stymied about getting it to work with CS6 Photoshop Extended (64-bit) - what am I missing?


When I run the filter (in CS6 64-bit), white isn't removed, instead the entire image gets all smeary as if the Oil Paint... filter had been applied.

 

Attempts in getting KillWhite to run from other CS installations on this 64-bit machine; CS4 & CS5.5 both 32 and 64, have been even more frustrating requiring re-entry of serial numbers, EUAs, etc., only to have PS fail to run at all even with several computer restarts and much testing.

 

Thanks for any help.

 

Kelly

 


Batch Export Separate Layer with the same Background Layer , Please HELP

$
0
0
I have the code as below, it worked in order saving separate layer to JPG, but it didn't include a Background layer to the JPGs which were exported.

Please help: I'd like all images exported has separate layer AND the same background.

Thanks in advanced.

============================================
// define your variables
var doc = app.activeDocument;
var artlayers = new Array();

// define your jpeg options
var options = new ExportOptionsSaveForWeb();
options.quality = 80; // Start with highest quality (biggest file).
options.format = SaveDocumentType.JPEG; // Or it'll default to GIF.

// loop through all layers
var x = 0;
var a = 0;
while(x < doc.layers.length)
{
// check if the layer is a item
if (doc.layers[x].kind == LayerKind.NORMAL)
{
// add to array
artlayers[a] = x;
a++;
}
x++;
}

// loop through our array of layers
// each loop will export a jpeg with 1 text layer visible and hiding the others
var x = 0;
var a = 0;
while (a < artlayers.length)
{
while (x < artlayers.length)
{
if (a == artlayers[x])
{
doc.layers[artlayers[x]].visible = true;
} else {
doc.layers[artlayers[x]].visible = false;
}

x++;
}

// export as jpeg
doc.exportDocument(new File("/c/variation_"+ a +".jpg"), ExportType.SAVEFORWEB, options)

x = 0;
a++
}
=============================================

Scripting New Crop Tool

$
0
0

I'm having a difficult time scripting the new crop tool.  Despite specifying the initial 4 corners, it quickly expands to fill the entire document before anyone can use it.  Any suggestiong on how to fix this??

 

Here's what I want:

 

Screen Shot 2014-02-26 at 2.33.56 PM.jpg

 

Here's what I get:

 

Screen Shot 2014-02-26 at 2.33.48 PM.jpg

 

Hee's my code:

 

// =======================================================

var idCrop = charIDToTypeID( "Crop" );

    var desc142 = new ActionDescriptor();

    var idT = charIDToTypeID( "T   " );

        var desc143 = new ActionDescriptor();

        var idTop = charIDToTypeID( "Top " );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idTop, idPxl, 100 );

        var idLeft = charIDToTypeID( "Left" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idLeft, idPxl, 100 );

        var idBtom = charIDToTypeID( "Btom" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idBtom, idPxl, 200 );

        var idRght = charIDToTypeID( "Rght" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idRght, idPxl, 200 );

    var idRctn = charIDToTypeID( "Rctn" );

    desc142.putObject( idT, idRctn, desc143 );

    var idAngl = charIDToTypeID( "Angl" );

    var idAng = charIDToTypeID( "#Ang" );

    desc142.putUnitDouble( idAngl, idAng, 0.000000 );

    var idDlt = charIDToTypeID( "Dlt " );

    desc142.putBoolean( idDlt, true );

    var idcropAspectRatioModeKey = stringIDToTypeID( "cropAspectRatioModeKey" );

    var idcropAspectRatioModeClass = stringIDToTypeID( "cropAspectRatioModeClass" );

    var idunconstrained = stringIDToTypeID( "unconstrained" );

    desc142.putEnumerated( idcropAspectRatioModeKey, idcropAspectRatioModeClass, idunconstrained );

executeAction( idCrop, desc142, DialogModes.NO );

Watch Folder

$
0
0

Hello,

 

Is there a way to have Photoshop watch a folder for new images and run some actions on the newly added files - after which removing the original from that folder.

 

I need to automate the follwoing:

Image is added to watch folder

Photoshop

  1. Detects new image
  2. Opens image
  3. Runs actions
  4. Saves to a new directory

File is deleted from watch folder.

 

I am on Mac 10.7 and have Automator at my disposal. I'm also familiar with scripting but not specifically for Photoshop so I prefer scripting would be the last resort.

 

Any help or guidance is greatly appreciated.

 

Thank you!

 

V

Help needed to enhance Image Processor Pro Script to save transparency in TIF

$
0
0

Hi everyone,

 

this is my first post in this community.

 

We have a droplet which reduces the resolution of tif images to 72dpi and save the tif image with transparency. This works fine, but it took to long for the whole process of many picture in different folders. That's the reason why we searched for another script which can preserve the folder structure and set the resolution of every tif image to 72dpi.

 

We found Image Processor Pro, which does exactly what we needed. The script works perfectly in CS5 and CS5.5 as it saves the tif with the transparency. Those saved tif images could be used in InDesign with the transparency.

 

BUT Image Processor Pro script works not so perfectly in CS6 as it seems that this option to save a tif with transparency is not implemented or does not work in the script. The result is that those converted tif images are w/o transparency in InDesign. That's a huge problem for us.

 

 

This is the point where I need your help. Neither I have experience yet with jsx-files nor with the right syntax of it.

 

Is there a way for anybody of you to implement / enhance Image Processor Pro so it will save tif with transparency?

 

We used the latest German Version of Image Processor Pro: 2.3.1 (link: http://www.russellbrown.com/scripts.html)

 

(The German version contains only german on screen texts!)

 

I am very thankful for every help you can give.

 

Thanks in advance for your help.


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?

Batch replace Smart objects in Photoshop

$
0
0

Hi all, thanks for taking the time to read this.  I have a file which is attached.

This file contains 6 different layers all using the same smart object.  So If I replace the smart object in one it'll replace them in all.

 

What I would like to do is to be able to batch replace all smart objects with a file found in an outside folder.  I currently have 500 images and I need to make 500 of the file you see here.

 

I would need to batch replace the smart object.

Then save the file to a different file name.

 

Any ideas?  It would greatly be appreciated.

 

Screen Shot 2014-02-24 at 4.12.36 PM.png

file uploader script

$
0
0

I am new to Photshop scripting. I am contempalting a sript which will upload files to a local server as well as a remote server.

Is this idea execuatable with the scripting allowances built in Photoshop CC?

How to get corner radius of the shape object.

$
0
0

Hi All,

 

I am trying to get the corner radius of the shape object.

 

Is there any way through which I can get the corner radius of all the corner of the shape object?

 

Thanks in advance..

Export layers to file script error in Photoshop CC

$
0
0

I need help with an issue.  I also asked this in the general forum but was refered here to ask all of you amazingly talented scripting geniuses.

 

My issue is with the Export Layers script that comes installed with Photoshop.  I am running Windows 7 64bit - using photoshop version: creative cloud 64bit.

 

When i try to run File>Scripts> Export Layers to files I get this error

Error 22: Windows does not have a constructor. Line: 239 -> dlgMain = new Window ("dialog", strTitle); 

When i load Photoshop Creative Cloud 32 bit i get a different error message when trying to run the script. 

Error - 33: Internal error . line:395 ->  dligMain.pnlFileType.pnlOptions.grpJPGOptions = ...

 

I can't run the image processor script I also get an error with that. 

 

This  is an issue for me as i use this script on a daily basis.  It worked in PSCS6  

I upgraded, i dont' want to have to load an older  version of photoshop to do this task  

 

Thanks

Carrie 

Will scripting be supported in the future?

$
0
0

Regarding the changes to be made next year for extensions support in the new Photoshop CC versions I must decide how to continue development of Photoshop tools, therefore I would like to know if, at least in short term, scripting will be supported in the next CC versions of Photoshop.

 

 

Thanks.

Batch processing PDF to TIFF

$
0
0
Hello,

I have about 1000 drawings in PDF format that I need to convert to B/W TIFF files. I thought I could easily do this in Photoshop (CS3) and then I hit a snag. In the Open form for the PDF there is a field to enter for the filename (I think that's because of multisheet PDFs). In my case all the PDFs have been reduced to single sheets, so I want the name to be that of the PDF file. Creating an action captures the "name", but this conflicts with the options when running in batch mode. I either have the same name from the action, or no name (or the same name) from batch options. Anyone know how to get around the naming options? Or do this a different way?

Thanks.

Passing arguments to the jsx file from command line

$
0
0
Thanks for taking my question.

I am using the following to be able to run my script from the command line.In case you were wondering on why i would be doing this- i would need to invoke the javascript from a server side code(like java,php etc. in my case it is java)

"c:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit\ExtendScript Toolkit.exe" "c:\path to script\myscript.jsx"

Anyways, i have been successful in running the myscript.jsx from the command line but i am not able to figure out how i could pass arguments to "myscript.jsx" from the command line, and be able to refer to these arguments within the script.

I have tried the following

"c:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit\ExtendScript Toolkit.exe" "c:\path to script\myscript.jsx" "argument1" "argument2"

and tried to refer these arguments within the script using arguments[0] and arguments[1] . But looks like this does not work.

Any thoughts?????

Scripting New Crop Tool

$
0
0

I'm having a difficult time scripting the new crop tool.  Despite specifying the initial 4 corners, it quickly expands to fill the entire document before anyone can use it.  Any suggestiong on how to fix this??

 

Here's what I want:

 

Screen Shot 2014-02-26 at 2.33.56 PM.jpg

 

Here's what I get:

 

Screen Shot 2014-02-26 at 2.33.48 PM.jpg

 

Hee's my code:

 

// =======================================================

var idCrop = charIDToTypeID( "Crop" );

    var desc142 = new ActionDescriptor();

    var idT = charIDToTypeID( "T   " );

        var desc143 = new ActionDescriptor();

        var idTop = charIDToTypeID( "Top " );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idTop, idPxl, 100 );

        var idLeft = charIDToTypeID( "Left" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idLeft, idPxl, 100 );

        var idBtom = charIDToTypeID( "Btom" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idBtom, idPxl, 200 );

        var idRght = charIDToTypeID( "Rght" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idRght, idPxl, 200 );

    var idRctn = charIDToTypeID( "Rctn" );

    desc142.putObject( idT, idRctn, desc143 );

    var idAngl = charIDToTypeID( "Angl" );

    var idAng = charIDToTypeID( "#Ang" );

    desc142.putUnitDouble( idAngl, idAng, 0.000000 );

    var idDlt = charIDToTypeID( "Dlt " );

    desc142.putBoolean( idDlt, true );

    var idcropAspectRatioModeKey = stringIDToTypeID( "cropAspectRatioModeKey" );

    var idcropAspectRatioModeClass = stringIDToTypeID( "cropAspectRatioModeClass" );

    var idunconstrained = stringIDToTypeID( "unconstrained" );

    desc142.putEnumerated( idcropAspectRatioModeKey, idcropAspectRatioModeClass, idunconstrained );

executeAction( idCrop, desc142, DialogModes.NO );

Help with large .psb 64-layer file

$
0
0

Hi All, I'm hoping someone here can help me with this!

 

I have a large 64-layer .psb, with each layer visible, the result looking like a 64-box matrix (or chessboard). Each layer has a high resolution image in it which comes from it's own separate .psd  What I want to do is replace each layer's content with a new file (I have 64 source files ready to go).

 

I have two questions:

 

  1. Will I need to step in to each layer of the .psb, delete the existing content, open the new .psd, and copy & paste it into the now empty .psb layer, and repeat x 63 times? Or is there a way that I can automate this?
  2. Can the .psb layers contain linked RAW files such that if I want to adjust one of the .psb layers, I need only open the RAW file in ACR and make my adjustments there?

 

I would be really grateful for your help on this, as I am a total newbie to scripting etc.

 

Many thanks in advance!

Batch Export Separate Layer with the same Background Layer , Please HELP

$
0
0
I have the code as below, it worked in order saving separate layer to JPG, but it didn't include a Background layer to the JPGs which were exported.

Please help: I'd like all images exported has separate layer AND the same background.

Thanks in advanced.

============================================
// define your variables
var doc = app.activeDocument;
var artlayers = new Array();

// define your jpeg options
var options = new ExportOptionsSaveForWeb();
options.quality = 80; // Start with highest quality (biggest file).
options.format = SaveDocumentType.JPEG; // Or it'll default to GIF.

// loop through all layers
var x = 0;
var a = 0;
while(x < doc.layers.length)
{
// check if the layer is a item
if (doc.layers[x].kind == LayerKind.NORMAL)
{
// add to array
artlayers[a] = x;
a++;
}
x++;
}

// loop through our array of layers
// each loop will export a jpeg with 1 text layer visible and hiding the others
var x = 0;
var a = 0;
while (a < artlayers.length)
{
while (x < artlayers.length)
{
if (a == artlayers[x])
{
doc.layers[artlayers[x]].visible = true;
} else {
doc.layers[artlayers[x]].visible = false;
}

x++;
}

// export as jpeg
doc.exportDocument(new File("/c/variation_"+ a +".jpg"), ExportType.SAVEFORWEB, options)

x = 0;
a++
}
=============================================

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?

Viewing all 12244 articles
Browse latest View live


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