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

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.

how get Layer ID from Layer Name ?

$
0
0

Hello everyone.

Tangled with the implementation of a small script.

I want to add to each of the selected layers of the Document a new layer with the image, make sure the top of each layer.

I think what I need:

1. Create an array of user-selected layers (necessarily by name)

2. Select image;

3. Pass through the array to create a layer, put in the new layer selected image and move the array over this layer.

Found an example where the array is created on indexes, but in my case it's not that - after each addition of a new layer indexes is changes .How do I get the index of the layer by its name?

Script UI blank

$
0
0

On PS CS6 (Still using that at work and not CC) I have a very lengthy script (about 7000 lines of code).  On multiple computers (Win 7), the script will run a few times and then the next time it's run, the UI is totally blank.  Photoshop then needs to be closed and restarted, and the script will work.  On some computers this occures after running the script just once.  Has anyone else had this happen or know what might cause it?

Saturation Script needed (New)

$
0
0

Hi,

I am new to scripting. I have tried to do this but failed miserably every time.

Could someone provide a script that would allow me to incrementally increase the saturation on the HSB slider by +3? So that every time I run the script it would go up by 3. I would also like to a similar script that would allow me to decrease the saturation by -3?

I am a digital painter and by increasing/decreasing the saturation while I'm painting would greatly increase my workflow.

Having similar scripts for hue and value would be greatly appreciated as well.

Any help would be appreciated.

Thanks!

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

Clipping path - automation

$
0
0

Hello,

 

For some time I have been trying to figure out a problem I am having with a script.

 

I have succeeded to write a script that does exactly what I want, wich is having Photoshop opening selected files, then apply the clipping path and finaly save as .png

 

The only problem I am experiencing is when Photoshop (CS 5.5) opens the selected number of files, it only applies the script to the first opened file, while the others remain unedited...

 

I was hoping to find some help and or a solution in solving this problem.

 

Thanks a lot in advance!

Kind regards,

 

 

    #target photoshop

 

//Input selection

 

var myInputFolder = Folder.selectDialog ("INPUT");

if(myInputFolder!=null){

    var myFiles = myInputFolder.getFiles(/.(jpg|psd|tif|png)$/i);

    for(var fileIndex=0;fileIndex<myFiles.length;fileIndex++){

        var tempDoc = app.open(myFiles[fileIndex]);

    }

}

 

//Track

 

docs = app.documents;

 

for (i=0; i < docs.length; i++) {

    doc = docs[i];

    app.activeDocument = doc;

};

 

//Unlock Layer

 

docLay=app.activeDocument.layers;

l=app.activeDocument.layers.length;

 

while (l>0) {

    l--;

    docLay[l].isBackgroundLayer = false;

    docLay[l].allLocked = false;

}

 

//Clipping path

 

    if (app.documents.length > 0) {

 

    if (app.activeDocument.pathItems.length > 0) {

 

    var thePath = app.activeDocument.pathItems[0];

 

    app.activeDocument.selection.selectAll();

 

    thePath.makeSelection(0, true, SelectionType.DIMINISH);

        }

 

    };

 

//Clear Selection

 

try {

app.activeDocument.selection.clear();

} catch(e) {

alert("Sorry, dit document bevat geen pad!");

}

 

//Resolution

 

   var doc = activeDocument;

   var res = doc.resolution;

   doc.resizeImage(undefined, undefined, 150, ResampleMethod.BICUBIC);

 

//Trim

 

app.activeDocument.trim()

 

//Save PNG

 

var doc = app.activeDocument;

var Path = doc.path;

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

var Suffix = "_DSok";

var saveFile = File(Path + "/" + Name + Suffix + ".png");

SavePNG(saveFile);

 

function SavePNG(saveFile){

    pngSaveOptions = new PNGSaveOptions();

activeDocument.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);

activeDocument.close(SaveOptions.DONOTSAVECHANGES);

}

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!

WorkSpace Saver ?

$
0
0

Does a "workspace" saver (aka Session Manager) exist for Photoshop CS5+ ? This is something I could use, as I tend to work with multiple images at the same time and when I can declaire one image as done then I close it. When time lapes having to open the images from scratch is a pain then trying to remember where to continue from.  If there was a "workspace saver" I could load the workspace and continue from their.


A script or action - Saving 1 image as .psd and hi res jpg and web jpg

$
0
0

So I notice when I am editing in Photoshop I almost 99% of the time when I am done editing a photo I save the image I am working on in a subfolder called "Finished" as ORIGINALFILENAME.psd.  Then I immediately run a simple action to crop that image to an 8x12 at 200dpi.  When that is done I then (manually) goto File Save As and save that image as "Print Only - ORIGINALFILENAME.jpg"  under the "Finished" folder.  Then I run another action that downsizes that image and does a FIT Image (1000px x 1000px) then I sharpen using unsharp mask (it also places my logo in bottom right corner).  Once that action is done I then (manually) save that image with File Save As "Web Only - ORIGINALFILENAME.jpg" under the "Finished" folder.

 

Is there a way to script this so I don't have to do this manually? 

 

 

Thanks for any and all help.

 

Ryan G

How to save layers with cropping?

$
0
0

I want to export layers to files (basically what "Export Layers To Files.jsx" does) but with cropping each layer (to different sizes). I know how to crop a document from script, but that also crops all other layers (erases their content outside of the cropping area). So my question is - how do I keep/retrieve the cropped out content of the document (layers)? Or maybe there's a better approach altogether?

TextItem.size is wrong after transform (CS 6)

$
0
0

Hey, i've a export script for Photoshop, which creates a XML file.

On field in this XML is the font size for each text layer. But the .size value is wrong when we transform the text layer.

Example and steps to reproduce:

 

  1. create a text layer
  2. set font size 6pt (font family doesn't matter)
  3. TextItem.size will export "6 pt"
  4. transform the text - make it larger
  5. Photoshop shows for example "12 pt" as the font size
  6. TextItem.size still exports "6 pt"

 

Is there any way to get the correct font size?

 

When transforming text, you will get a value like "11.9999 pt" (you mostly don't get a round number).

But when you try to set the font size to 12 pt manually, TextItem.size still exports the old value.

 

The exporter works great in CS 3, the font sizes are correct. But in CS 6 its wrong.

Is this a PS bug maybe?

 

Alex

Scripting the path in Quick Selection Tool

$
0
0

Hi,

 

I'm trying to build a JS script which:

 

1. opens an image

2. selects the quick selection tool

3. does the selection following a pre-defined path

4. puts the unselected area to white

5. saves the image

 

The problem is in step 3. All the other steps can be recorded with ScriptListener, but the path is not. So the question is:

 

How can I tell to my script a path to follow while using Quick Selection?

 

How can I do it, for example, with a very simple path, say a line from pixel (50,50) to (50,200)?

 

Many thanks!

Create strip from image sequence

$
0
0
I need a script or action, or droplet or something that will take a folder of images and create One Image strip from it. Basically I have animations I have rendered out as frames that I need to put in a game. The game needs the images in one file with all the images side by side (or on top of each other I think) The frames are all one size (but different for each sequence) It takes about 4 hours for me to do this now. And then if it has to change it's four more hours...

Any thoughts idease or techniques?

C

Additional scripted patterns

$
0
0

Hi all,

 

I am the developer of the Deco scripting engine that is used to create scripted patterns in Photoshop CS6. I would like to continue the interesting discussions and exchange of patterns and images that many of you started on the pre-release forum.

 

If you go to the following page (link) you can get a brief overview of how to add new scripted patterns to Photoshop CS6.  Check out a few Deco scripts that create boundary patterns. The size of the boundary depends on the width

of the input pattern – you want a wider boundary, create a wider pattern.

 

Feel free to ask me any questions related to pattern scripting.

 

Enjoy,

Radomir

Most efficient way to read accurate 16 bit color data?

$
0
0

I'm working on some digital imaging & color management research using Photoshop, and I'd like to optimize my speed and accuracy. I'm aware of some command line tools like imagemagick, but since we are working with custom profiles and our end users will be using Photoshop, I'd like to stay within the Adobe CMM ecosystem to ensure that our testing reflects the real world usage.

 

I'm working with high-res 16-bit RGB and Lab files- I'm interested in gathering data from images of ColorChecker SG target cards. I've tried scripting two ways to read target color information:

 

  • Color Samplers
    • Pros: Accurate 16 (aka "15+1") bit readout of color. Lab values with decimal precision.
    • Cons: Each color sampler is only a point sample. I've scripted out creating an average readout of various pixels, but it is slow.
      • Checking one point sample/square gives an inaccurate result, takes only about 30 seconds
      • Checking/averaging a 3x3px area takes 13 seconds/square X 140 squares on the chart (~30 mins/chart)
      • Checking/averaging a 50x50px area takes 400 seconds/square X 140 squares (~15 hours/chart)
        • There is an average ∆E of 0.26 between the 3x3 and 50x50 readings, indicating that more is better, but 50x50 is probably overkill. However I'm looking to be able to process multiple charts daily, so even if the 3x3 was accurate enough, it would still be slower than I'd like.
  • Histogram
    • Pros: Fast. Takes 30 seconds to read 140 patches, averaging an area of 50x50px per reading
    • Cons: The histogram data is only 8 bits, even for a 16 bit original. Less accurate recording of color data.
      • Comparing the histogram data to the 50x50 color sampler data yields an average ∆E = .753, min ∆E = .56, max ∆E = .99

 

So really, I'd like the speed of the histrogram matched with the accuracy of the 16 bit color sampler... Any thoughts? I'm currently using AppleScript because I find it easier to get things up and running, though js is a possiblity.

 

Here's a snippet of code from the Color Sampler way- I think it's pretty lean code while it loops here, but perhaps there's something that could speed it up?

 

                              repeatsampleSizetimes

 

                                        repeatsampleSizetimes

 

 

                                                  tellcurrent document

                                                            settheSamplertomakenewcolor samplerwith properties {class:color sampler, position:{currentX, currentY}}

                                                            settheValuestocolor sampler coloroftheSampler

  deletetheSampler

 

                                                  endtell

 

                                                  setvalueLsumtovalueLsum + (value_LoftheValues)

                                                  setvalueAsumtovalueAsum + (value_aoftheValues)

                                                  setvalueBsumtovalueBsum + (value_boftheValues)

 

 

 

                                                  setcurrentXtocurrentX + 1

 

                                        endrepeat

                                        setcurrentXtocurrentX - sampleSize

                                        setcurrentYtocurrentY + 1

 

                              endrepeat


Expand/Contract Layer Groups

$
0
0

So I spent the evening researching a way to expand/contract a layer group.. normally we have to click on the small triangle icon that appears before the layer name in the layers panel to expand the group, and click it again to fold it all up. So far, I've found information stating that it can't be done via scripting...

 

I thought up one way to do it, and that would be to search a layer by name (using a different script), and make sure that the layer name being searched for is inside of a contracted group.. and when that layer name is found and selected, it will unfold the layer group and show select the layer. It's quite a runaround though. Is there a more efficient way to do it with a script?

Unlocking Background Layer with lots of other layers

$
0
0

I've been looking at the similar questions, but no script has worked perfectly yet. I have a series of phoshop actions that I run on a regular basis. I have two version of each, one for if there's a locked background layer, and one for when its already been unlocked. Otherwise my actions error.

 

I'd like to simplify the process and have a script run that finds any locked layers (ie: background) and unlocks it, even if there are 15 other layers and even if I have another layer selected. It should also run without errors if there are no locked (background) layers to be found.

 

I don't know the first thing about writing my own scripts, so can somebody tell me what lines of code I'd need? Thank you Thank you!

Export animation via Scripting

$
0
0

I need to export photoshop animation to my own format. Exporting as GIF image is not a solution. I need to access transformation details, change of opacity through the timeline in photoshop motion.

 

How can I do this?

Can this be done using a plugin?

Is it possible with scripting?

CS5.5 (MAC) script to fix random dots in lineart scans

$
0
0

Hello there.

 

In my line of work, I often have to scan text only documents to  print offset. The majority of the scans are clean but ultimately there will be random dots which need to be tidied up. I am looking for a way to streamline this process.

 

I was able to find a solution which I had in mind but it requires converting the lineart scan to 8-bit first. The example can be found at: http://verlagmartinkoch.at/software/cleanup/index.html

 

However, has anyone heard of an action or javascript that could do this without having to convert to greyscale and then back to lineart?

 

I have read DOZENS of DIY guides and posts suggesting always doing black and white scans as greyscale first and then converting them, but without going into tremendous detail, I will simply say that the scans I receive will output as lineart.

 

Many thanks

 

colly

Auto crop each layer before exporting layers to files

$
0
0

The built in "Export layers to files" script doesn't crop the exported jpeg to the size of the image on each layer.  Instead, it keeps the original photoshop file size and puts white around that layer's image.  Is there a script that will crop to the layer size before doing the export for each layer?

Viewing all 12244 articles
Browse latest View live


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