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

Is it worth it for me to learn scripting in PS?

$
0
0

I have absolutely NO experience with javascript, and I have failed miserably every time I have attempted to learn. Should I leave Photoshop scripting to the pros?

 

I work in an environment where we are using PS to create super-high-end imagery seen the world over. We are doing things here that make Adobe's engineers' heads explode. We are automating a lot of our process, and actions have gotten us only so far. Scripting is the next logical step, but I'm not sure if it's within my abilities.


PS3 script to batch rename layers

$
0
0
Sometimes, I make copies of layers (for example: copy little diamonds to align into a shape of the letter M). Each time I "alt+drag" the content in that layer (to make a copy of it), PS makes a copy and then appends the name of the layer to something like "diamond copy 3". After making a ton of copies (and because I'm anal about having actual names for each layer), I want each layer to read "diamond". Instead of manually renaming all these layers, is there a way to highlight the affected layers and choose to rename all layers according to what you want?

Since the CC update Document.saveAs() always opens a dialog

$
0
0

Is anyone else seeing this?

Is there a work around?

 

This is a script I have been using for months to open Illustrator files in Phohoshop, resize them, and then save as PNG.   The source images are dynamically generated and it is impractical to sit around waiting to click on the save dialog after every one.   This is a new issue for a script I have been using for a long time.

 

Photoshop 14.2 x64

Extendscript Toolkit CC 4.0.0.1

Script to open 2 versions of the same file one JPEG and one TIFF - the nrun action in a batch format

$
0
0

I have 2 folders of images.  One is a folder of JPEG files that have paths created for the image.  The second folder is an identical image except it is a TIFF file with no path.

 

I have created an action that takes the path from the JPEG and places it on the TIFF and performs some work for me.  What I can't figure out is how to batch this????

 

I am thinking i'd need a script to open the first image in each folder run the action then move onto the next image in each folder and so forth.

 

 

Any help would be soooo wonderful.

 

If you know of a script or can point me in a direction that would be great!

Getting help with Ps Scripting is a Nightmare

$
0
0

I need a script to replace layers. PS CS5

$
0
0

Ok, let's say I need to replace layer (x) with layer (y), of course, Layer (y) is not in the composition.


(NOTE: layer (y) is a Vector Smart Layer while layer (x) is a regular layer named "Layer 4")

And yes each Layer (x) is named "Layer 4"


The Problem is ... There are 59 of layer (x) in the composition, and I need to replace each and everyone with layer (y)!


I would do it manually although it's time consuming, but there's also the problem that the PC slows down as I open the composition because it is 732MB and 900+ Layers, So I figured out the best way to do it is with a script, But unfortunately I have no idea how to type a script and when I googled it, I found 1 Script that can do so but it did not really work!

 

The one I tried appeared as so,

 

var prefix = "so_";
var assetPath = "assets/"  
var count = 0;
listLayersets(app.activeDocument);
listLayers(app.activeDocument);
var path;  
function listLayersets(pointer) {     for (var i = 0; i < pointer.layerSets.length; i++) {        var layerset = pointer.layerSets[i];        listLayers (layerset);    }}  
function listLayers(pointer) {    for (var i = 0; i < pointer.artLayers.length; i++) {        var layer = pointer.artLayers[i];        if (layer.name.indexOf(prefix) == 0) {            if (layer.kind == "LayerKind.SMARTOBJECT") {                app.activeDocument.activeLayer = layer;                replaceSO (app.activeDocument.path + "/" + assetPath + layer.name + ".psb");            }         }    }}  
function replaceSO (newFile) {          var id = stringIDToTypeID( "placedLayerReplaceContents" );    var desc = new ActionDescriptor();    var idn = charIDToTypeID("null");    desc.putPath( idn, new File(newFile));    var idp = charIDToTypeID("PgNm");    desc.putInteger(idp, 1);          executeAction(id, desc, DialogModes.NO);          return app.activeDocument.activeLayer}

 

I don't really understand most of that, but all I got was that I need to layer x to be renamed as so_layer (x) and layer (y) needed to be renamed as so_layer (y), also layer (y) was needed to be put in a folder named "assets" ,but unfortunatly I can't rename them all because they are alot and mixed up between many files and folders, not to mention the slow PC.

 

The result from a prototype file, was a faliure, no message, no nothing

Execute() command not working on Photoshop CC

$
0
0

This code works perfectly on CS6 but not on CC. Any ideas on how to solve it?

 

var toGo = File(String("/Users/asouza/Documents/K3/test/test.log"));          

toGo.execute();

 

Thanks,

Alex

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


Set zoom in CS5

$
0
0

We've been using the below Java code to set the zoom of a document in Photoshop 7 (yeah, I know - ancient) to fit the screen (like hitting Ctrl + 0 on the PC) but it no longer works in CS6. The runMenuItem command is generating "Error 1242: Illegal argument - argument 1."

 

 

function runMenuItem(item){// from xbytor
cTID = function(s) {return charIDToTypeID(s); };
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( cTID( "Mn  " ), cTID( "MnIt" ), cTID( item ) );
desc.putReference( cTID( "null" ), ref );
executeAction( cTID( "slct" ), desc, DialogModes.NO );}
runMenuItem("FtOn");// fit on screen ( same as ctrl-0 )

 

Is there some other way this can to be done in CS6?

 

Thanks,

Ken

automate save with adding a number

$
0
0

Hy all,

 

this is the situation:

 

I have got a psd file. I want this file to be saved automatically as Documentname1.png while it originally is Documentname.psd.

 

The script doesn't have to ask what number i want to add, i can find that in the script and change that myself.

 

It also have to save the file in another folder than where the Documentname.psd is saved.

 

Could anyone creat a script for this action? I don't have any experience at scripting at all.

 

Tnx!

(CC) Save all Layer Masks as Alpha Channels

$
0
0

Hello,

I've looked everywhere and can't seem to find a script to do this. I am looking for a script to simply check every layer for a layer mask and if there is one, save it as an alpha channel. The layers may or may not be in groups. No need to delete the masks, just save them as alpha channels. I have a lot of images with a lot of masks and it's a pain trying to save them manually! I thought this would be pretty easy but from what I've been reading this might be a little over my head. I would really appreciate any assistance!

 

Thank you in advance,

 

Danny

Photoshop - combine red and green channel images into a merged image?

$
0
0

Hi,

 

I am a developmental biologist carrying out experiments on a type of microscope known as a Confocal Laser Scanning Microscope (CSLM).  Basically, this is a microscope coupled to some lasers which allow fluorescently-labelled parts of a biological sample to be imaged in high detail.

 

For each sample there will be a set of two images produced, named and numbered as follows:

 

sample01_g.tif

sample01_r.tif

 

Each image represents one fluorescent wavelength and correspond to green ( g ) and red ( r ).  These images are in rgb colour.

 

I want to produce a merge of these two channels to generate a new TIFF file such that:

 

Green channel is taken from sample01_g.tif

Red channel is taken from sample01_r.tif

 

Which would show me how the different channels co-localise, or not.

 

This is fine to do by hand in Photoshop, but takes a long time when you have a couple of hundred images to process.  So, what I would like to do is write a script that batch automates the process, like a droplet.  I have the process outlined below:

 

  1. Create a new RGB TIFF called sample01_merge.tif
  2. Take the green channel from sample01_g.tif and copy it to the green channel of sample01_merge.tif
  3. Take the red channel from sample01_r.tif and copy it to the red channel of sample01_merge.tif
  4. Save sample01_merge.tif into a folder named "Merged Images" on the desktop
  5. Close the opened images
  6. Go to next set of images –> sample02_g.tif and sample02_r.tif
  7. Create a new RGB TIFF called sample02_merge.tif....and go through step 2-6, untill the last set of images has been processed.

 

I have never used script before and would love to learn, but I am making slow progress and would like to have this problem solved sooner than I will be able to do so by myself.  So... I was wondering if anyone could give me some advice on how to go about doing this?

 

Any help will be greatly appreciated!

 

I use a Mac Pro running OSX 10.8.3 and Photoshop CS6 Extended

 

Best regards,

John

Looping for a Layer Name ?

$
0
0

I want to create a loop that checks if a layer with a set name is within a group, then save the layer group, if not, look outside any and all layer groups for a layer with a set name, if not, ignore and save the selected layer group ?

HELP NEEDED!! batching, overlaying, background cut out

$
0
0

Hi All,

 

very new to this.

 

I have 2500+ images (caracitures of cars on white backgrounds). I need to place ALL of them on to  a BLACK tee shirt image for internet listing.

So, how do I do this automated?

 

make the thing background BLACK

overlay image on the teeshirt

save it in the order they are done

 

2500+ times

 

I use Photoshop 7.0

Save as for layer group

$
0
0

app.documents.add( 4, 4 )

jpgFile = new File( "/Temp001.jpeg" )

jpgSaveOptions = new JPEGSaveOptions()

jpgSaveOptions.embedColorProfile = true

jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE

jpgSaveOptions.matte = MatteType.NONE

jpgSaveOptions.quality = 1

app.activeDocument.saveAs(jpgFile, jpgSaveOptions, true,

Extension.LOWERCASE)

 

In the Adobe Scripting guide, above is the code for JPEG.  Instead of JPEG, I want a LayerSet to save as a TIF with the 'without layers' and 'save as copy + alpha' enabled ? I searched the guide, could not find if I can link group properties color with a keyboard short-cut ?


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

 


How to get the style of a layer using photoshop scripting ??

$
0
0

As I know  there is a method  ApplyStyle(string)  which is uesd to apply the specified style to a layer. But I really don't know how to get the style name of a layer ?

Anyone who knows? Please help me!   Thank you !

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?

rotating brushes using file stream of saved brushes in javascript

$
0
0

Once again I’m fascinated by a query in the MacIntosh-forum which’s solution I suspect is within JavaScript’s reach but out of my depth – namely:

Can one rotate a brush by Keyboard Shortcut, like in- or decreasing its size or softness?

I mostly use the round brushes myself, so it’s not like I even miss the capability …

 

I suspect by saving a Brush Preset, then saving that one alone as an abr-file, deleting the Brush Preset, reading and editing the abr.file, loading it, selecting the single Brush Preset contained and deleting it, too, one might achieve it.

Of course editing the abr-file with a Script seems a bit risky to me.

 

On xbytor’s advice I downloaded HexEditor, but the Brush Tip Shape-Angle-setting mystifies me … »AnglUntF#Ang@« seems to be the one but I fail to understand the angle-value …

 

Furthermore the total number of brushes (for indexing purposes) eludes me.

 

Anyway, the procedure may be too complicated or time-consuming to make any practical sense (apart from inserting numerous steps in the history, which might be a further drawback in real working conditions), but I guess some of You like exploring theoretical applications of Scripting-techniques, so maybe You could give me Your opinions/advice on the whole matter.

Naming Layer Set ?

$
0
0

var layer_c = app.activeDocument.layerSets.add();

layer_c.layerSets.add().typename("layera");

 

How do I name a LayerSet ? What am I doing wrong ?

Viewing all 12244 articles
Browse latest View live


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