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

Display thumbnail of PSD on ScriptUI dialog

$
0
0

I'm wanting to display a thumbnail sized jpeg or png image representation of a high resolution PSD on my ScriptUI dialog, and without having the PSD open and active. Any advice or suggestions to get me started in the right direction is much appreciated.

 

JJ


Export only a single layer as image without hiding other layers?

$
0
0

I know I can just make only one layer visible and then save as e.g. PNG. But my question is - do I have to make all other layers invisibile in order to save only my one single layer as image? Or is there a way to save only a single layer (or a few at once) without hiding the rest of them?

Possible to add 1,2,..,N different buttons on conditional array length?

$
0
0

I have an array with 1, 2 , or more elements

 

I want to open an UI dialog with buttons as many as my Array length.

 

AND I want to be able to personalise every single function() onClick for each single existed button

 

The problem is that I can't make the code reconize each individual button once have been created.

Resize Layer with action but not in %

$
0
0

Hi,

if i register an action to resize a layer in inches or in pixel, the action will be registered only in %.

So if i would like to resize many layer with different dimensions, i can't have all in the same dimensions.

How i can do it?

Is there a script?

Regards,

Vincenzo

How to check the layer's color?

$
0
0

color.png

I want to check the layer's color in the photoshop script (javascript). I'm writing a file exporter and I want to do one thing or another depending on the layer's color.

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

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

 


CS6 png save options

$
0
0

I've got a major script I use that performs .png saving every few seconds, but apparently there are some new compression options in CS6.  Is there a way for me to have the script use the "Smallest / Slow" compression option if CS6 is in use?  I currently use the script below for saving:

 

 function SavePNG(){    permSaveFile = new File(permSaveFile);    pngSaveOptions = new PNGSaveOptions();    activeDocument.saveAs(permSaveFile, pngSaveOptions, true, Extension.LOWERCASE);}

 

How would I add the extra CS6 save option in while still being able to use the script with older versions as well?  The rest of the script works fine and it saves fine under CS6; the only reason I need to change this is, the output files are HUGE using it, as is, under CS6.  Thanks for any help!

 

dgolberg


Save in file location?

$
0
0

Hey all. I'm really confident with actions, but new to scripting. I'm looking write something to 'save as' a file into the open file's location. So whatever file I'm working on, when I run the action or script it will save to the current folder. I haven't found a way to do this with actions so I want to know if I can with scripts.

 

For example, on the desktop I have a test1 folder and test2 folder. I can record an action to save an open image from test1 to test1, but then open images from test2 go back into test1. My work around right now is another action (file/automate/batch) to run the saving action and open the dialog box where I can direct it where to save.

 

I appreciate any help.

-Matt

Getting old font size value of text after image resizing.

$
0
0

Hi all,

 

I write the script of getting font size of the text layer. I am getting old font size after image resizing.

 

Following are the steps:

- I write the function to get the property of selected text layer..

 

     getInfoOfText=function(textLayer)

     {

          ........;

          var textItem = textLayer.textItem;

          var fontSize = textItem.size;

          .........;

     }

 

- After image resize to 50%. I am executing this function.

 

But, I am still getting old font size value.

Let's say the font size of text = 36 px.

Now I apply Image Resize to 50%. So, the font size of the text becomes 18 px.

Now If I execute the function "getInfoOfText", I am still getting 36 px.

 

I am unable to understand the behaviour. Am I missing something here? Is there any way to get the correct font size value?

Please note that I am using CS6 version.

 

Waiting for ur help guys.

 

Thanks

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?

Select all layers with the same name

$
0
0

I'm setting up a bunch of actions in PS Cs5 but I've hit a wall with the way photoshop selects layers by name.

If I name two layers "example" and have an action that selects "example" it will only select the bottom layer.

Is there a workaround using actions? And if no, is there a way to do this by script?

 

(Word of warning, I have never tried anything with photoshop scripting so assume I know nothing about it.)

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.

Hide/Show specific layers

$
0
0

Hi,

 

How can I Hide specific layers and then show one layer?

 

Im making a pannel with configurator 4 to help me with some things.

 

what I would like to do is, I have some layers and I want to show only one of them.

 

Example:

I have these groups in my psd file

 

-Overlays

     -Overlay 1

     -Overlay 2

     -Overlay 3

     -Overlay 4

     -Overlay 5

     -Overlay 6

     -Overlay 7

     -Overlay 8

     -Overlay 9

 

And I need to have them all off exept one. But i dont want to effect the other layers in my psd.

A script for "Save for Web" as .jpg

$
0
0

I found a script that saves the current selected document in Photoshop as .png to the Desktop, and use it all the time.

 

function main() {

          // declare local variables

          var doc = app.activeDocument;

          var docName = app.activeDocument.name.slice(0,-4);

 

 

    var saveFile = new File("~/Desktop/" + docName + ".png");

    pngSaveOptions = new PNGSaveOptions();

    pngSaveOptions.interlaced = false;

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

}

 

main();

 

 

Now I'd really like a similar script to do "Save for Web" as .jpg files, without a colour profile, to the Desktop. Preferably a version to save as 100% quality and one to save as 60% quality.

Any help would be greatly appreciated.


Mantain the same name with whitespace

$
0
0

I'm trying to make some batch operations on images. All works great, but I noticed that the image name are changed.

 

When I save my image, if the name contains space, photoshop automatically convert this whitespace to "-". I want preserve my image name, because I have those informations stored in the database and after the change name I cannot find the correct path of the image.

 

For example an image called "Google Analytics.png" become "Google-Analytics.png" but I DON'T want that extra "-".

 

This is my script routine:

 

 

function SavePNG(saveFile){    var file = new File(saveFile);    var pngOpts = new ExportOptionsSaveForWeb;     pngOpts.format = SaveDocumentType.PNG    pngOpts.PNG8 = false;     pngOpts.transparency = false;     pngOpts.interlaced = false;     pngOpts.quality = 100;    app.activeDocument.exportDocument(file,ExportType.SAVEFORWEB,pngOpts); 
}

Photoshop Actions and Batch Processing Snafu

$
0
0

Good Day,

I need to batch process thousands of files, the end result being their dimensions should be no larger than 200x200px. My problem lies that I need to rotate the portrait-oriented files to a landscape orientation. We deal with many rectangular files (originally as big as 5 foot by 10 foot) and I would like the end result to have everything horizontal (i.e. the vertical ones resting on their side).

 

I set up an action to pause and ask me if I wanted to rotate (it was a vertical file), then every file after asked the same question in which I clicked cancel because I did not want the horizontal files to rotate, and thus the action did not save the rest of them.

 

Is there any action or script I could use that has an "If/Then" sort of scenario? For example, *if* the dimensions are taller than wide, *then* rotate, otherwise leave the file alone?

 

Thanks!

Conditional Image Resizing

$
0
0

Hi

 

Ive been using batch processing in photoshop since version 7, however Ive recently found the need to do conditional actions - which apparently can be done with photoshop scripting.

 

What Im trying to do is resize an image if it is over a certain size (document dimensions that is) but leave it at its original size if not.

 

If I was coding in C or something Id probably do (forgive the poor pseudo code)

 

if(document.height*document.width>640000){document.resize("50%");}

 

Can anybody point me in the right direction for creating this type of script in photoshop CS4?

 

Many thanks

 

James

About progress bar and Photoshop

$
0
0

I have been reading a lot about how to make a progress bar in photoshop (scripting) and my conclusion is that it is not worthy. The only way to make a progress bar is by using Palette window but Photoshop does not support it. If we use a dialog window, since it is modal, it will freeze whatever your script is doing so, you cannot use it (how to track the progress of a script if the script is paused while the dialog is being shown?). Although Photoshop does not support Palette, there are two workarounds that would make it work and they are using either app.refresh() or waitForRedraw() (and undocumented function that seems to me to do exactly the same thing that app.refresh() does). But as the manual says, app.refresh() will slow down considerably your code. According to my experimentation, each time you call app-refresh(), your script will waste about 1 second (no matter how powerful your computer is). That is a lot of time! In practical terms, you would use app.refresh() only a few times so your progress bar could be refreshed only a few times during the whole duration of your script, still one second lost for each time you use it. In other words, there is no good way of making a progress bar in photoshop scripting.

 

My question is: am I right? Is there a way to code a progress bar in PS that would not delay the code unreasonably?

time of opening document

$
0
0

Hi,

 

is there a property to read, at what time a document was opened.

Target is to know how long it took to edit a document.

File will be opened via the File - Open dialog, at that point no scripting involved,

but at the end the file is saved by using a javascript. In that script i wan't to make a log file with edit time

Viewing all 12244 articles
Browse latest View live


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