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

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 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!

How to add a color sampler through Photoshop Scripting?

$
0
0

Hi,

 

     I would like to fix a color sampler point through Photoshop Scripting?

 

Could you please help me on this.

 

thanks,

rajiv.s

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.

ExtendScript Problem

$
0
0

I'm new to scripting and trying to test out ExtendScript. I'm using Photoshop CS5 on a Windows 7 machine.

 

I found a file ExtendScript Toolkit.exe in Program Files (x86)/Adobe/Adobe Utilities/ CS5/ ExtendScript Toolkit CS5. When I double click on this, the expected ExtendScript window opens briefly and immediately closes.

 

What might be causing this, and how can I get the window to stay open?

 

Thanks.

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

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

Windows does not have a constructor: 244 error message

$
0
0

I'm using CS6 for the first time to process some RAW files using the Photoshop Automate>Fit Image script. When I tried opening one RAW image into Photoshop to create an action I got the following error message:

 

"ReferenceError: Windows does not have a constructor: 224"

 

Never seen that in all my years of using Photoshop. What's causing this and how do I fix it?


Exporting line end point coordinates?

$
0
0

Hi,

 

I'm in desperate need of a script to export the coordinates of lines, or paths, it doesn't really matter, into a text document.

 

I've set my ruler up so the 0,0 is in the center of the image, because I need both 0,0 and -0,-0 to work for what I have in mind, basically using a document as a large Cartesian grid, which you can then extract coordinates of 'edges' or end points of lines from.

 

A little background on why I need it, for anyone curious. I figured out a way to build new worlds/maps for a game that generates terrain based on 'boundaries', which are drawn on, in a 2d plane, but I need coordinates to map these boundaries correctly. I could do it manually, where I'd hover my mouse over every edge or end of the line point, but this would save a LOT of time.

 

I'd be insanely grateful if anyone can help me out. I've tried looking for scripts or other software, but haven't been successful at all for what I really need.

 

The way I have my document setup is, 1 pixel per cm, 16384x16384cm. It's quite large, so most 'graph' software won't work for it. The grid itself works fairly well, I just need a decent way to export the coordinates from it.

 

Thanks in advance!

 

 

Edit:

 

Here, I made an example of a rectangle to give you guys the idea of which coordinates I'd need:

http://i.imgur.com/VILOwrL.png

Getting help with Ps Scripting is a Nightmare

$
0
0

Select/Change Certain Color

$
0
0

Hello,

 

I have been scripting in various Adobe products for a while but I am simply stumped on this one.

 

I have a series of PNG files that consist of various shapes. The shapes are solid black and the rest of the document is transparent.

 

I wrote a script to pull all the documents into one new Photoshop file and place each file/shape on its own new layer.

 

I then randomize the order of the layers. This in theory generates kind of a unique "pattern".

 

What I want to do now is change the black pixels of each layer to a different color.

 

For example, all the black pixels in layer 1 will be changed to red. All the black pixels in layer 2 will be changed to green, etc, etc.

 

Since the black PNG shapes are randomly placed in different layers, this will again give a very unique and colorful pattern.

 

I am good up to this point. However, I cannot figure out how to change the black pixels to a specific color using the scripting interface.

 

I thought of selecting only the black pixels and then filling with a color. Couldn't figure out how to do that. Thought of applying a color shifting script. Couldn't figure out how to do that. I even thought of apply a style or filter. Couldn't figure out how to do that either.

 

Any help or suggestions or examples would be greatly appreciated.

 

Thank you!

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

Data Sets in Photoshop CS2

$
0
0
I'm trying to learn about scripting in Photoshop CS2. By starting, I just want to import variable data into Photoshop, following the help instructions, however am having heaps of issues.

I'm using the Image > Variables > Data Sets > Import option.

My data looks like this..

Variable1
Ben
David
James
Mark

but when I try to import the text file, I get this error message...

"Could not parse the file contents as a data set. There were too many variable names in the first line of the text file."

Can anyone please tell me what I'm doing wrong?

Thanks

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 

Creating .ACB (Color Book) file from .ACO (swatches) file

$
0
0
Is there a way to convert a .aco file to a .acb file? I really need my colors to be visible in the Color Libraries section of Photoshop to use with Color Layers.

The .acb files are the files located in \Program Files\Adobe\Adobe Photoshop CS2\Presets\Color Books.

Please let me know if anyone knows how to do that, it would be really helpful!

how to select and paint the triangle?

$
0
0

I want to make an imitation cutout mat.

Created and filled two colors 4 rectangular areas - sections mat. Now you need to fill in the corners. I can calculate pixel by pixel rows and fill them, but it seems to me that there must be a simpler solution.In the example script - create a blank document, fill the new layer rectangel area (this will portray the picture) in the Layers palette make this layer active and run the script.

Help me paint 2 color corner number 2 :-)

 

Thanks !

 

 

#target photoshop; 
var fillColor1 = new SolidColor()
fillColor1.rgb.red = 255;
fillColor1.rgb.green = 10;
fillColor1.rgb.blue = 10;
var fillColor2 = new SolidColor()
fillColor2.rgb.red = 155;
fillColor2.rgb.green = 50;
fillColor2.rgb.blue = 100; // you can change this parametr
var widthSrez = 20; 
main(0) 
function main(type){//---------------------------------------------------------    var mySelection =new Array(4);    for(var o=0;o<mySelection.length;o++){    mySelection[o] = new Array(4)    }    var doc =  app.activeDocument;    var bounds = doc.activeLayer.bounds;    var newLayer = doc.artLayers.add();    newLayer.name =  'Срез'switch(type){    case 0:    //left        mySelection[0][0] =bounds[0].value;        mySelection[0][1] =bounds[0].value+widthSrez;        mySelection[0][2] =bounds[1].value;        mySelection[0][3] =bounds[3].value;        mySelection[0][4] =1;    //top        mySelection[1][0] =bounds[0].value;        mySelection[1][1] =bounds[2].value;        mySelection[1][2] =bounds[1].value;        mySelection[1][3] =bounds[1].value+widthSrez;;        mySelection[1][4] =1;   //right        mySelection[2][0] =bounds[2].value - widthSrez;        mySelection[2][1] =bounds[2].value;        mySelection[2][2] =bounds[1].value + widthSrez;        mySelection[2][3] =bounds[3].value- widthSrez;        mySelection[2][4] =2;   //bottom        mySelection[3][0] =bounds[0].value+ widthSrez;        mySelection[3][1] =bounds[2].value;        mySelection[3][2] =bounds[3].value-widthSrez;        mySelection[3][3] =bounds[3].value;        mySelection[3][4] =2;    break;    case 1://other type    break;     case 2://other type    break;    case 3://other type    break;}             for(var p=0;p<mySelection.length;p++){            var newSelect = Array(                Array(mySelection[p][0], mySelection[p][2]),                Array(mySelection[p][1], mySelection[p][2]),                Array(mySelection[p][1], mySelection[p][3]),                Array(mySelection[p][0],mySelection[p][3]),                Array(mySelection[p][0],mySelection[p][2])                ); 
 doc.selection.select(newSelect);       if(mySelection[p][4]==1)           doc.selection.fill (fillColor1, ColorBlendMode.NORMAL,100,false);        else{            doc.selection.fill (fillColor2, ColorBlendMode.NORMAL,100,false);            //in this place paint the corners !!               }           doc.selection.deselect()     }}   

 

 

PrtScr capture.png

determine the number of pages of a pdf before any operations on it

$
0
0

Do any of You know how to determine the number of pages of a pdf-file (selected with the openDialog for example)?

Somehow I fail to grasp how to achieve that any way short of actually opening/rasterizing all pages without prior knowledge of the actual number.

 

 

I would like to use that information to determine the number of elements for a contact-sheet-like procedure beforehand.

 

MultiPageImporter2.0.jsx, which is an Indesign-Script by Scott Zanelli, obviously does it, but so far I’ve failed to successfully utilize his functions.

 

 

Anyway, have a nice weekend

pfaffenbichler

Importent for me: How to replace miss font with script in Photoshop?

$
0
0

My photoshop is CS6 version.


Often,some PSD  file come frome client ,when you open is,you find a lot of fonts missed.

Specifically,some fonts have 2 version,For example,FZHT.ttf and FZHT_GBK.tff.

For safety reasons,we have only install the GBK version,for it is Contains more characters,it is new.

we never install the old version.

but,the situation like this very very much. It  wasted me a lot of time.

So I would like to get a script:can Automatically replace the miss fonts to Other,According to my pre-set.

 

For example,I pr-set:

Font A change to Font B

Font D change to Font B

 

Who would like to help me.........

Best to wish to you ~

Thank you very very very very much!

Copy Layer Name To Clipboard?

$
0
0

Hi, I've been searching for a way to copy the active layer name to the Windows Clipboard, I'm hoping this a quick solution. What I've managed to do so far is to open the layer properties dialog box, then hit 'CTRL+C' to copy the layer name (because the layer name is already highlighted at this step), and then this successfully copies the layer name to the Windows Clipboard.

 

But I find that when the system is under load, the layer properties dialog box is sometimes slow to open, and even so, it seems like it's an extra step that could be eliminated.

 

I searched through the keyboard shortcuts, and also through all the layer menus for a keyboard shortcut to just 'copy layer name to clipboard' but can't find anything.

 

Anyone know if there's a quick keyboard shortcut to do this or perhaps a quick script that will just copy the layer name?

 

Thanks in advance..

View command history

$
0
0

Hi-   Is there a way to view your history in script format? What I mean is, view a print-out of your command history like it would appear as if you were executing a series of script commands (in order to view the correct script syntax for whatever you're doing).  The 3D software Maya has this, and it is extremely useful.  I'm guessing Photoshop doesn't have this - ?

thanks,

-d

Viewing all 12244 articles
Browse latest View live


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