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

Marking distance with path automately

$
0
0

The blue line is a path with some anchors, then I stroke it with blue brush.

 

What I want is marking distance lables automately like the red lables with script.

When i supply 3 parameters, the min value ,the max value and lable numbers, and select some anchor, I run the script so that the lables can be painted in a new layer.

licheng.jpg

Thanks all.


Error: OWLPanelManager.cpp : 3936 : REQUIRE failed

$
0
0

Hi there,

I'm trying to batch the following script on a remote CDN containing more than 9000 subfolders:

 

// get a reference to the current (active) document and store it in a variable named "doc"
doc = app.activeDocument; 


if(doc.name.indexOf('ws')>0){    var filename = doc.name.replace(".jpg", "");  var origName = filename+'_o.jpg';  var origFile = File(doc.path+'/'+origName);  if(!origFile.exists) {  // change the color mode to RGB.  Important for resizing GIFs with indexed colors, to get better results  doc.changeMode(ChangeMode.RGB);  var jpeg_options = new JPEGSaveOptions();  jpeg_options.embedColorProfile = 1;  jpeg_options.formatOptions = FormatOptions.STANDARDBASELINE;  jpeg_options.matte = MatteType.WHITE;  jpeg_options.quality = 11;  doc.saveAs(File(doc.path+'/'+origName), jpeg_options, 1);  // these are our values for the END RESULT width and height (in pixels) of our image  var fWidth = 3000;  var fHeight = 3000;  // our web export options  var options = new ExportOptionsSaveForWeb();  options.format = SaveDocumentType.JPEG;  options.quality = 90;  options.optimized = true;  // do the resizing.  if height > width (portrait-mode) resize based on height.  otherwise, resize based on width  if (doc.height > fHeight || doc.width > fWidth){  if (doc.height > doc.width) {  doc.resizeImage(null,UnitValue(fHeight,"px"),null,ResampleMethod.BILINEAR);  }  else {  doc.resizeImage(UnitValue(fWidth,"px"),null,null,ResampleMethod.BILINEAR);  }  }  doc.exportDocument(File(doc.path+'/'+doc.name),ExportType.SAVEFORWEB,options);  }
}


app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

 

The script works perfectly if I test it locally with a brunch of folders.

 

When I create a droplet or when I run a batch into the CDN (mounted a ) I have the following problems:

  1. Photoshop freezes for more than an hour before starting the files cycle.
    What can I do to avoid this idle?

  2. Photoshop tries to open Thumbs.db files and it logs me this error for every folder:
    Error: Could not complete your request because Photoshop cannot recognize the file extension. (-25600)
    Is there a way to make a batch process try to open just the readable files?

  3. For all the images (both the ones that I would like to be resized and the ones that I just need to skip) it returns me the following error:
    Error: Could not complete your request because of a program error. (-1)
    That in the PSErrorLog.txt turns out to be:
    2016:05:20 16:01:53 : ..\..\sources\OWLPanelManager.cpp : 3936 : REQUIRE failed

     

    No image is resized or saved in this case..
    What does it means? How can I solve this error?

 

Anyone could help?

Thanks a lot!

Modify a script

$
0
0

Hi,

I have a script (made by a friend) which gives me the measurements of black pixel of a document (single column by single column).

It actually takes the first black pixel in a single pixel column and the last one (whatever is the color between them).

Now, I want to actualize this script to give me the measurements of each black area of a single column (for example 4 measurements if the column is getting 2 black pixels + 3 white pixels + 5 blacks pixels).

How may I do that ?

Thanks in advance for your help !

 

Get active layer name for saving the document

$
0
0

hi,

 

I am struggling to get rid of this code, actually i am new in scripting i have a script of following:

 

  1. var bottonLayerName = app.activeDocument.layers[app.activeDocument.layers.length-1].name
  2. var currentDocFolder = app.activeDocument.path;
  3. app.activeDocument.saveAs( new File( currentDocFolder +'/'+ bottonLayerName +'.psd'));

 

I just want to change this script to select TOP layer instead of bottom layer name and do not copy in .psd format please help its urgent.

 

or any other script that save as jpeg with top layer name...

 

Thanks in advance

Scripts Event Manager stopped working

$
0
0

I have an issue where the Scripts Event Manager won't save my event manager preferences.  I use the interface, but when I click done, I get back "Cannot open file to save /Volumes/Users/tim/Library/Preferences/Adobe Photoshop CC 2015 Settings/Script Events Manager.xml."  I have tried changing permissions, backing up my system with Time Machine, and reinstalling Photoshop several times to no avail.  Does anyone have ideas as to what is causing me problems?  Thanks! 

script and action not working (cs6? german?)

$
0
0

i recently found a great workaround for animating in photoshop, thanks to actions and script with the help of the amazing SuperMerlin

 

it works perfectly fine at work, where I have an English win8 & English PS CC,

but at home (German win10 & German PS CS 6) it does not. I'm using the exact same action and script (see link http://we.tl/Tu9fIrLYHl) so I'm pretty clueless what could be the reason.

there are two problems:

 

1. Choosing between layers doesn't work. instead of scrolling through them, my computer at home only chooses the first and the very last, but skips everything inbetween. It's the 'Select forward/backward layer'-action in the F2-function which should enable me to cut a layer in the timeline.

 

2. Using the scripts does not work. They should enable me to always have the playhead of the timeline at the currently chosen layer. the actions for this are on F3 (backward) and F4 (forward).

 

It would be amazing if there was a way to fix the problem as I have an extremely important examination coming up where i can only use my home equipment (the g. win10 & g. PS CS6 one).

Thank you

PhotoShop Plugin

$
0
0

Hello everybody,

 

I would be pleased if you can help me, I need to make a plugin that can interact with photoshop so i can execute it from the terminal without needing to open photoshop anymore and deal with a group of images that need to be put in HDR panorama forms. To sum it up, i would know if there is a means that can realize the automata and how. You can ask me more if it's no too clear. Sorry to my poor english

 

Thank you very much guys!!

Callback triggered several times

$
0
0

Hi,

 

I'm having problem with callbacks in Photoshop CC 2015.

Callback is trigger several times making my script running for a long time.

Any tip on how to bypass this problem ?


Ajout d'un masque automatique

$
0
0

Bonjour,

J'ai un cadre transparent dans lequel je voudrais intégrer une par une des photos en arrière plan. Je voudrais savoir comment procéder afin d'automatiser la tâche. En effet, je dispose de plus de 300 photos et les faire une par une c'est chaud

 

Merci par avance

Jessy G.

Select Crop Tool and select a ratio (based on Filename)

$
0
0

I have lots of files that when I crop them they need to a specific ratio. Currently they are saved to the tool.

 

I would like to be able to make a shortcut so that it selects the crop tool and selects the ratio from the File name. I can gather the info from the filename.

 

i.e.  FR10 = a Ratio of 2:3

or

DE20 = 3:4

 

It does not need to crop the image just select the tool.

I found this to select the tool

The beginning is like this.

if (app.documents.length > 0) {    var myDocument = activeDocument;    var fileNameNoExtension = myDocument.name;     fileNameNoExtension = fileNameNoExtension.split( "." );     if ( fileNameNoExtension.length > 1 ) {      fileNameNoExtension.length--;    }    fileNameNoExtension = fileNameNoExtension.join(".");       var BrandString = fileNameNoExtension.substr(0,4);   }
if (/^(FR10|WA35)$/.exec(BrandString)){    var the_x_Ratio =2    var the_y_Ratio =3    }

MenuID for Arrange 2-up Vertical

$
0
0

I want to send a Bridge talk message to photoshop and tell it that I want the images I'm opening up to be viewed as 2-up Vertical.

Does anyone know how to get MenuID's or the menuID for this action?

Thanks in advance.

PS Event for Undo not triggered ?

$
0
0

I'm having trouble with some events that are not triggered

 

// Events "undo"

__event.data = "1970168943";

__csInterface.dispatchEvent(__event);

__csInterface.addEventListener("com.adobe.PhotoshopJSONCallback" + __event.extensionId, psCallBack);

 

but nothing is fired

What's wrong with it ?

Please help How to prevent ExtendScript toolkit from opening automaticully and showing the jsx script ?

$
0
0

I am trying to create a custom panal for photoshop based on photoshop jsx script. I want to secure the script from stealing. I created the panal and scripts are running fine through it but when I press Alt key from keyboard and then run the script from panel then automatically ExtendScript Took kit 2 pops up and show the jsx script which anyone copy and modify. I wish and would be thankful if anyone could help me how to prevent this from happening. To secure the jsx script i even tried converting them to jsxbin file but jsxbin file doesnt work with photoshop CS2 and that too show up through ExtendScript Tool kit when i press Alt key. Please someone help me how to secure the script from showing up..I have seen photoshop extension like "layer control 2" in which we can't see the script but those are zxp format panal and mine is .exe panal. Please help or suggest any alternate solution . Thanks in advance

photoshop scripting slices

$
0
0

I came across a thread in the Photoshop Forum that I thought might present an issue easily addressed via Scripting:

Cycle through Slices option window

 

But I have had little success in evaluating or addressing Slices via Script, I have been able to figure out selecting a Slice by its position (not index or ID or name) and renaming or deleting it, but that hardly seems useful for a generalized approach.

Also I noticed a couple of unanswered posts on the issue so there seem to have been shortcomings which may still linger.

Has anyone of you by any chance concerned themselves with Scripting Slices yet and could provide some insight and/or sample Scripts?

How to get or set units?!

$
0
0

Hey Guys!

 

I have some extensions that measure the width and height...

but if the

Edit menu>> preferences >> units are in centimeter

the result of the measurement will be faaaarrr different than in pixels

like:

43 in cm

500000 in pixels...

 

is there any option for getting the units type or setting it permanently or temporarly?!?

 

I found this one but it didnt do anything:

app.scriptPreference.measurementUnit = app.MeasurementUnits.PIXELS;

 

 

any help would be appreciated!!

 

Thanks!!

Ben


Random opacity layer

$
0
0

Hello to all I want to know if you can vary the opacity of the layer so random

if you can do you kindly post the code

thank you

HTML5 inputs not showing

$
0
0

Hi Guys & Girls,

 

I have been developing a panel using HTML5 and I'm seeing to have issues with radio & check boxes. I have added them as you would normally via HTML but nothing shows.

 

Am I missing anything in particular or is there something I don't know of?

 

          b50addace5.png

 

  

889eff2232.png

As you can see the checkbox itself isn't rendering. I am having the same issues with radioboxes, but not textboxes.

 

Does anyone have any idea why they are not working?

 

on a side note, has anyone had issues with javascript and document.getElementById("MyElement") within the panels? I've had issues which I wont get into yet but I was just wondering.

 

Thanks heaps,

 

Dylan

?how to export file name & date created as text?

$
0
0

(to speed up copyright registration workflow)

 

I am registering batches of images.

I need file name followed by date created, e.g.,

 

0304d, Jan 31, 2003 (or 1/31/2003 or 1/31/03)

0305d, Jan 31, 2003

etc etc etc

0556d, May 26, 2003

etc etc etc

 

Want to avoid time-consuming manually

typing whilst looking at data in

Bridge or CS6 ACR...

 

Advice appreciated!!  Thanks in advance.

Create folder in last used folder loacation (aka current folder)

$
0
0

HI,

 

I am stuck with a part of my script.

 

After the script has done a whol lot of work to multiple files I would like it to run the following script tosave a jpeg of the file in a folder called Print. This folder needs to be created in the current folder that was last used by photoshop. I looked in the discussion boards but could not find what I needed.

 

I tried the:

// getting the name and location; 
var docName = thedoc.name; 
if (docName.indexOf(".") != -1) {var basename = docName.match(/(.*)\.[^\.]+$/)[1]} 
else {var basename = docName}; 
// getting the location, if unsaved save to desktop; 
try {var docPath = thedoc.path} 
catch (e) {var docPath = "~/Desktop"}; 
// create folder if it does not exist; 
var folderString = docPath+"/"+basename; 
if (Folder(folderString).exists == false) {new Folder(folderString).create()}; 

But this only works if the file has already been saved somewhere. This is not the case and I also do nit want to save the PSD first.

 

So I Tried the folder.current approach but I do not get the results I am looking for. Any help would be appreciated.

 

 

var idsave = charIDToTypeID( "save" );
var desc9 = new ActionDescriptor();
var idAs = charIDToTypeID( "As  " );
var desc10 = new ActionDescriptor();
var idEQlt = charIDToTypeID( "EQlt" );
desc10.putInteger( idEQlt, 12 );
var idMttC = charIDToTypeID( "MttC" );
var idMttC = charIDToTypeID( "MttC" );
var idNone = charIDToTypeID( "None" );
desc10.putEnumerated( idMttC, idMttC, idNone );
var idJPEG = charIDToTypeID( "JPEG" );
desc9.putObject( idAs, idJPEG, desc10 );
var idIn = charIDToTypeID( "In  " );
//========================================================================================
var basePath = Folder.current;
var folderString = new Folder(basePath + "/Print");
if (Folder(folderString).exists == false) {new Folder(folderString).create()};
//========================================================================================
desc9.putPath( idIn, new File( "" ) );
var idDocI = charIDToTypeID( "DocI" );
desc9.putInteger( idDocI, 35 );
var idsaveStage = stringIDToTypeID( "saveStage" );
var idsaveStageType = stringIDToTypeID( "saveStageType" );
var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
desc9.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
executeAction( idsave, desc9, DialogModes.ALL );

Adaptive text color on custom panels - how?

$
0
0

I'm trying to make my own panel for some scripts but I don't seem to be able to make plain text (in the HTML-file) - such as labels for input-fields - work as it does natively in Photoshop. Instead I'm stuck with black regardless of what theme I have active in Photoshop.

Placing the text in a p-tag with no CSS on it doesn't work either so what am I missing here?

Viewing all 4008 articles
Browse latest View live


Latest Images

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