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

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


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

Script for deleting Hidden Layers which are not used in any Layer Comp?

$
0
0

Hello.

 

I've turend the web upside down searching for a script that would do the following:

 

  1. Search through all the layer comps in the document
  2. Check which layers are hidden on all Layer Comps
  3. Remove/mark with color the layers found.

 

If anybody can provide a script that would do such a thing - it would be highly appreciated.

 

Regards,

Fade.

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!

I need to create an action or script to save the file with the name of the selected layer

$
0
0

I need to create an action or script to save the file with the name of the selected layer (not including the hidden layers, but including those visible).

 

 

How could modify the script: 'Layer Comps To Files.jsx' to get the result?

 

 

Warning: I do not need to export all layers as files.

 

 

Who can help me?

 

THX in advance

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

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.

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

how to convert pixels in mm ?

$
0
0

Hello everybody!

I'm making a tool in which the user specifies the size of the frame, I want to give him the opportunity to choose between units of measurement. How do I convert one unit to another? Centimeters to millimeters as I know :-)

The calculations in my instrument produced in pixels. A user wants to place on a sheet of paper photos of a certain size in order to then cut them after printing and pasted into the frame.

 

This part of the script produces the  selection of the pixel size, but calculation was conducted in millimeters.

app.preferences.rulerUnits = Units.MM;  
var newSelect = Array(                   Array(Left, Top),                   Array(Right, Top),                   Array(Right, Bottom),                   Array(Left, Bottom),                   Array(Left, Top)
 );
 doc.selection.select(newSelect); 

 

Came up with a solution, I do not know how much it is optimal - use factor

app.preferences.rulerUnits = Units.MM;
rmm = doc.width;
app.preferences.rulerUnits = Units.PIXELS;
rpix = doc.width;
var propPixMm = rpix.value/rmm.value;

Find a color and add an anchor point script

$
0
0

I'm super close to having this right but I get very inconsistent anchor points to show up.

 

The problem is that sometimes I get two per pixel and sometimes it will miss some of the colors that match the hexvalue I am looking for.

 

I'd like for this to be consistent in adding an anchor point to the top left hand corner of the pixel that mathes the hexvalue.

 

Any help would be much appreciated! Code below ...

 

CODE: SELECT ALL

function main(){

var startRulerUnits = app.preferences.rulerUnits;

app.preferences.rulerUnits = Units.PIXELS;

 

var myHeight = app.activeDocument.height;

var myWidth = app.activeDocument.width;

 

// Find pixel Color

for(var x=0; x<myWidth; x++) {

  for(var y=0; y<myHeight; y++) {

   activeDocument.colorSamplers.removeAll();

   var sampler = activeDocument.colorSamplers.add([new UnitValue (x, 'px'), new UnitValue (y, 'px')]);

   if (sampler.color.rgb.hexValue === "502905") {

 

      var pname = 'Path ' + Math.floor(Math.random()*10000000000000000);

 

      var startPoint = new PathPointInfo();

      startPoint.anchor = [x,y];

      startPoint.leftDirection = [x,y];

      startPoint.rightDirection = [x,y];

      startPoint.kind = PointKind.CORNERPOINT;

 

      var stopPoint = new PathPointInfo();

      stopPoint.anchor = [x,y];

      stopPoint.leftDirection = [x,y];

      stopPoint.rightDirection = [x,y];

      stopPoint.kind = PointKind.CORNERPOINT;

 

      var spi = new SubPathInfo();

      spi.closed = false;

      spi.operation = ShapeOperation.SHAPEADD;

      spi.entireSubPath = [startPoint];

      var line = activeDocument.pathItems.add(pname, [spi]);

 

   }

 

  }

}

}

main();

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.

Copy Layer's Parent Name to Clipboard

$
0
0

Hi

 

I have a script which copies the active layer's name to the clipboard (thanks to the users in this forum):

 

 

 

 

app.system( "echo "   + activeDocument.activeLayer.name + " | CLIP");

 

 

 

 

...Is there a way to copy the active layer's Parent name to the clipboard instead?

 

or to take it a step further, copy the Parent name first, then copy the active layer name?

 

For example, it would copy to the clipboard:  "Group 1- Layer 1"

 

(meaning that there is a group entitled "Group 1", and inside that group is 'Layer 1' (which, by the way,  would also be the active layer))

 

 

Or if that's too complicated, then just to simply copy the parent name.

 

Hope this makes sense...

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 ?

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


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!

Getting help with Ps Scripting is a Nightmare

$
0
0

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.

CC API lacks closedDocument networkEventSubscribe event all of a sudden?

$
0
0

Hey,

 

I can't seem to get Photoshop CC under OSX (Mavericks and pre-mavericks) to dispatch a closedDocument event, has it been removed or has it's name changed?

 

The plugin SDK for the AIR SDK and the Android SDK all mention it still, and it works nicely under CS6 (been using three different versions at least for SC6).

 

Example:

var idNS = stringIDToTypeID("networkEventSubscribe");

var desc1 = new ActionDescriptor();

desc1.putClass( stringIDToTypeID( "eventIDAttr" ), stringIDToTypeID( "closedDocument" ) );

executeAction(idNS, desc1, DialogModes.NO);

 

Tata,

Erik

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!

Viewing all 12244 articles
Browse latest View live


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