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

Need action to open save dialog box and STOP there. Help!!

$
0
0

So here is the background info, in case it helps to know why I am looking for this option - I am pulling photos off an internal company database. I can not access these photos as regular files - I have to go to our website, input an employee number, and right click, copy. Therefore, any options related to batch editing, if they'd even help otherwise, are out for this first step

 

In the meantime, I have created an action that opens a new doc, pastes the photo in, and resizes it. Assigned f5 as the shortcut. Then, to save my dexterity (:P) I also reassigned the "open save for web & devices" shortcut to f6.

 

However, this is such a massive project, and coming to a time-crunch, that I'd really like to take the action I created even further to cut out that second step (open save w/ f6).

 

I've googled and apparently am not phrasing the question right, no matter how hard I try.

 

HOW in the world, if possible, can I add a step to my action that simply OPENS the save for web & devices dialog box? I know how to make it open and save, but no more than that. I need to open and just STOP there, so that I can simply hit enter and input the desired file name.

 

Is this possible?! I'll love you forever if you can tell me that it is and how to accomplish it! Btw, I am on Photoshop CS4.


Photoshop CC 2018 on windows 10 with limited graphics memory

$
0
0

When i upgrade from photoshop 2017 to 2018,  i get the "System.Runtime.InteropServices.COMException (0x8001010A): The message filter indicated that the application is busy. "  exception in my vbscript.  The photoshop is running on windows 10. Please help!

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.

Not getting multiple subpaths from selected shape layer

$
0
0

I'm trying to get multiple subpaths from a single shape layer with jsx, via PathItem.subPathItems. Shape layers can sometimes contain multiple subpaths, depending on the Shape. For instance, the letter "O" contains two subpaths, the outer ring and the inner ring.

 

This works if the shape is manually created with the pen tool. But it doesn't work when this character is converted to a path from a font. In this case, Photoshop only returns the outer path and I see no way to get the details of the inner path.

 

I have a very concise example psd + jsx file that can be downloaded here (link will be active for the next couple of days, but will update it if needed): WeTransfer

 

I hope my problem is clear. Has anyone else encountered it and, even better, does anyone know a solution?

Script to copy Group of layers without adding word "copy"

$
0
0

When you make a copy of a group using duplicate(), the word "copy" is added at the end of every layer inside the group and its subgroups.  Is it possible to make duplicate() not add "copy" at the end of layer's name. Disabling "Add copy to copied Layers and Groups" in layer panel settings doesn't affect the running of script.

I came up with recursive solution that removes copy from name, but it runs extremely slow on a large file with hundreds of layers. Are there more elegant solutions.

Structure before duplicating:

+Group1

      +Subgroup

          -Layer1

          -Layer2

Structure after duplicating:

+Group1 copy

     +Subgroup copy

          -Layer1 copy

          -Layer2 copy

+Group1

     +Subgroup

          -Layer1

          -Layer2

 

var original  = app.activeDocument.layerSets.getByName("group1");
app.activeDocument.activeLayer = original;
var copy = source.duplicate();
recFixName(copy);

// Recursively removes copy from name
function recFixName(curr) {
  var str = curr.name;  var target = "copy";  var match = 0;  var pos = 0;  var i = 0;  while(i < str.length) {  if(str[i] == target[match]) {  match++;  pos = i;  }  i++;  }

Running multiples scripts as sequence

$
0
0

Hi,

 

I'm using 4 scripts to manage all my website dev, to exports images, slice, etc..  It's an amazing way to work with scripting, god I love it !

 

I wonder if I can link all my script together so I don't have to wait for each one to end then start the next one manually.

 

Is there a way to script this so once my first script is done, it start the next one... and so on... an on... ?

 

 

Thanks guy if you have an idea !

Performance profiling

$
0
0

Any way to profile performance of JSX layer to find bottlenecks?

I noticed that on Windows 10 my script is running significantly slower than on MacOS.

Still, on both platforms it would be great to profile and find which methods take the longest to run and where are the bottlenecks.

 

Any tools already available for that?

whitelilne appeared in the exported pdf to png

$
0
0

Hi,

 

I have a script to export PDF to PNG. While exporting the PNG the png is exported and a thin line appeared in the output as well as text blured.

 

Is there any way to overcome the hairline and text blur.

 

app.preferences.rulerUnits = Units.PIXELS;
app.displayDialogs = DialogModes.NO;
var fileRef = new File("D:/Cover/settings.csf");
loadColorSettings(fileRef);
fileRef = new File("D:/Cover/input.pdf");
var pdfOpenOptions = new PDFOpenOptions();
var resolution = 72;
pdfOpenOptions.antiAlias = true;
pdfOpenOptions.mode = OpenDocumentMode.RGB;
pdfOpenOptions.resolution = resolution;
pdfOpenOptions.page = 1;
pdfOpenOptions.cropPage = CropToType.BLEEDBOX;
pdfOpenOptions.constrainProportions = false;
pdfOpenOptions.bitsPerChannel = BitsPerChannelType.EIGHT;
var outerBorderColor = new SolidColor();
outerBorderColor.rgb.red = 0;
outerBorderColor.rgb.green = 0;
outerBorderColor.rgb.blue = 0;
var saveOptions = new ExportOptionsSaveForWeb();
saveOptions.format = SaveDocumentType.PNG;
saveOptions.PNG8 = false;
saveOptions.quality = 60;
saveOptions.blur = 0.0;
saveOptions.includeProfile = true;
saveOptions.embedColorProfile = true;
saveOptions.interlaced = false;
saveOptions.optimized = true;
saveOptions.colorConversion = false;
var doc = app.open(fileRef, pdfOpenOptions);
doc.trim(TrimType.BOTTOMRIGHT, true, false, true, false);
var docwidth = doc.width;
var docheight = doc.height;
doc.resizeImage(docwidth,docheight,resolution,ResampleMethod.BICUBIC);
app.displayDialogs = DialogModes.ERROR;
doc.flatten();
doc.selection.selectAll();
var saveFile = new File("D:/Cover/output.png");
doc.exportDocument(saveFile,ExportType.SAVEFORWEB,saveOptions);
doc.close(SaveOptions.DONOTSAVECHANGES);
app.displayDialogs = DialogModes.ERROR;
function loadColorSettings(file)
{    var desc = new ActionDescriptor();    var ref = new ActionReference();    ref.putProperty( charIDToTypeID('Prpr'), stringIDToTypeID('colorSettings') );    ref.putEnumerated( charIDToTypeID('capp'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );    desc.putReference( charIDToTypeID('null'), ref );    var fileDesc = new ActionDescriptor();    fileDesc.putPath( charIDToTypeID('Usng'), file );    desc.putObject( charIDToTypeID('T   '), stringIDToTypeID('colorSettings'), fileDesc );    executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
}

 

Thanks

Jayaraj


Image Processor Pro not available in Bridge CC 2018

$
0
0

After updating to Photoshop CC 2018 and Bridge CC 2018 the Image Processor Pro (IPP) does not display under the Bridge > Tools > Photoshop menu.

The IPP dependencies were copied from the Photoshop 2017 to Photoshop 2018. The IPP can be accessed from Photoshop CC 2018 > File > Automate > Image processor Pro.. but not from Bridge CC 2018.

 

Currently, Photoshop CC 2017 and Bridge CC 2917 are installed locally and the IPP does display under the Bridge > Tools > Photoshop > Image Processor Pro...

Which IPP version have Mac users been able to successfully install in Bridge CC 2018 in OSX High Sierra?

 

Environment:

OSX High Sierra

MacBook Pro 2015

Scripting Lens Correction to process millions of photos

$
0
0

We have several million "Fish-Eye" images that we need to flatten out and the new "Lens Correction" feature of Photoshop CS5 appears to work pretty well.  I was able to use the predefined File -> Automate -> Lens Correction function to process a hanfull of images and it worked fine for a small batch.

 

I would like to know if there is a way with Photoshop CS5 to script/batch out a process so that I can use it to process the millions of individual files we need to have processed.

 

Also, I am not familiar with the Photoshop "Batch" or "Scripting" process, so assuming the above request is possible, some direction on how to proceed would be greatly appreciated.

 

Thank You.
Lee

converting actions into script

$
0
0

Hello Guys,

 

Might be a quick answer for you or maybe not.

I have never scripted anything in my life (except a few macro files in excel) and I am green to this.

 

Simple question - I have a few "actions" in photoshop and I would like them to be converted into scripts as it might come handy for the future as I will be working with some scripters.

So how do I transform this ATN file into a script?

 

The reason behind it is that I am already having one action that has 2 scripts in it and in the future I want to add more, so I will need someone scripting to work on the script itself not actions.

 

Maybe it is also counter-productive so give me your opinion,

 

thanks.

 

Olaf

apply logo and suitable for different sizes

$
0
0

Hello to all

 

 

I do not know if it is possible to do this

 

 

I have a folder on the desktop with the name watemark

inside this folder there are 2 png files

logo_white.png

logo_black.png

 

 

I would like when I have to apply one of these logos on an image

must be done automatically must be placed on the bottom left

must analyze the surface

if dark it applies the logo_white.png

if it is clear, apply logo_black.png

 

 

second passage

I use 3 SLRs with different mpx

nikon d700 has 12 mpx

nikon d610 has 24 mpx

nikon d800 has 36 mpx

I would like the logo that is applied to have the same dimensions

on all formats.

 

thank you

Using mouse wheel to zoom and pan

$
0
0
I was wondering if there would be a way to make a javascript that would load at Photoshop's startup that would allow the user to zoom in and out using the mouse wheel (instead of using it for scrolling), and to use that same mouse wheel as a third button (when you push on the mouse wheel) or any third button on a three button mouse to pan in your image. I'm a 3ds max user and I love the way the navigation work in that software so it'd be great to be able to do that for Photoshop and Illustrator and get rid of those useless key shortcuts that we need to use to zoom and pan.

For the pan fonction, I guess if there was a way to simply say "when the third mouse button is pressed, press the space button, until the mouse button is released" it could work. But then it would force the panning to stop when the mouse goes offscreen, unlike in 3ds max where you can pan for whatever distance you want, even if you have the loop throught the screen ten times.

For the zoom function, if scolling up could simply "push" the keyboard shortcuts to zoom in/ zoom out it could work, but I don't know if that's possible. And then we'd have to disable the scrolling up and down in the document.

Anyways, if anyone has any ideas about that let me know! I've been looking for that for such a long time!

How to get HSB values of layer or document in Photoshop CC 2017 (in my case Brightness of layer)

$
0
0

I tried do find a code and one have found:

Get values of adjustment layer

but it doesn't work in CC 2017.

I know that getting Brightness of layer manually is dependent on pixel being hovered but the idea is to get highest or mean value of brightness.

Getting brightness of all values or maximum or mean of a document would be a solution because I could hide other layers at start and get values as it would be only one layer. But how?

Thanks in advance

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?


Get values of adjustment layer

$
0
0

Is it possible, to get for example the brightness and the contrast of a brightness/contrast adjustment layer?

I found only for solid color layer.

Getting Image Luminosity from Histogram?

$
0
0

Is there any clean, easy way to do this? I'm trying to create a conditional script that only applies certain effects if the image is above a certain luminosity level.

 

Thank you for any help!

how do I get the name of the action that was started from within my javascript?

$
0
0

Hello,

 

I want to create an action called 'test1' and record it playing a script called 'generic.jsx'.

I want the script to know that it was started by 'test1' and thus, do XYZ.

I want to create another action called 'test2' and have it play the same script called 'generic.jsx'.

From within that same script, being a generic one, I want to to now know that it was started by action 'test2' and do ABC.

 

How can I have my javascript know the name of the action that launched it?

 

Thanks in advance!

 

---

Shai

Script for making random thumbnails from single image

$
0
0

Hi all,

 

I need something like a hundred different thumbnails from each image in a series of images, that is, hundred random sections of the same image, saved in a folder as jpg,  and i was hoping that i could find a script for this.

 

What the script has to do is:

 

  1. select the size of the crop (this would also be the dimensions of the thumbnail saved)
  2. rotate crop selection in a random orientation and place the crop randomly on the canvas
  3. save the image as a jpg in a folder
  4. return to original image,
  5. repeat process x times before quitting script.

 

I dont think this should be to difficult to make a script for, but unfortunately i don´t know how to code.

 

Is there anybody that could help me with this?

 

This would save me a lot of time!

Script Alert: "Sorry I could not process the following files" (Error Message using Image Processor)

$
0
0

I'm a seasoned Photoshop/Bridge CS5 user who recently upgraded to CS6.  In Bridge I just ran my first Image Processor batch, trying to convert a set of RAW .NEF files to .PSD files with a basic editing action I created applied to them.  Photoshop CS6 opens the files from Bridge and applies the actions, but then I get the "Script alert" error message "Sorry I could not process the following files" and a list of all of the files in the batch I was trying to run the script on.  The files all remain open and are saved on my hard drive in a folder created by the Image Processor script, but do not close unless I manually close them.  I never had this problem in CS5 where the image processor would apply the desired actions to the batch of photos one at a time, then save and close.  Thoughts on how I can fix this bug?

Viewing all 12244 articles
Browse latest View live


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