Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all 27456 articles
Browse latest View live

Re: Start script if one layer is clicked

$
0
0

Pfaffenbichler, thanks for the idea...I will try.


Re: Help - Way to filter files

$
0
0

Hi Tomas, thanks for your help again. I´ll try this.

Re: Embed multiple images based on condition?

$
0
0

JJMack

Your script is fine

but I would use to Tomas which I think is more comprehensive for my needs.

CEP panel and C++ plugin communication

$
0
0

Hi everybody,

 

Described problem occurs on Adobe Photoshop CC 2017 (C++ plugin).

 

I'm trying to send an JavaScript event from my HTML CEP panel via CSInterface and receive it on C++ plugin side. Javascipt seems to work fine, events are sent without any errors, example of an event below:

 

 

  const csInterface = new CSInterface();
  const event = new CSEvent(

   'com.example.panelname.getData', // panel ID with .getData as event name
   'APPLICATION', // scope
   undefined, // Application ID (Docs says it is in optional, so i'm sending undefined)
   csInterface.getExtensionID() // this method returns proper panel ID
  );
  csInterface.dispatchEvent(event);

 

How to capture this event on Photoshop C++ plugin side? Is anything else required on JS side that i'm not aware of?

Re: CEP panel and C++ plugin communication

Re: Removing numbers from file names when exporting layers to files???

$
0
0

Once again, this doesn't match the "Export Layers To Files.jsx" I have on my system. The document I have only goes up to Line 1330.

Re: Removing numbers from file names when exporting layers to files???

$
0
0

Strange because im using cc2017, .. What you should do is either use Dreamweaver or download Atom or w.e program your using and search for those lines and make the adjustments. I was searching for a solution just like you yesterday but didn't find an answer. That's the solution that I had to do. also make sure your not looking at the layer comps to files .jsx

Re: Removing numbers from file names when exporting layers to files???

$
0
0

I'm currently using dream weaver. I'll do a search for those specific lines and see if I can work something out.

Thanks


Re: Removing numbers from file names when exporting layers to files???

$
0
0

If you still cant find it let me know id be more than happy to look at the file for you if you duplicate it.

Re: Embed multiple images based on condition?

$
0
0

Please start new post with your request, because it's different from what OP requested.

Help with UI: Script execution order when selecting Radio and Checkbox options

$
0
0

I need to modify a dialog box that contains Radio and Checkbox options to run two different events on the same task, however, I'm having a huge Difficulty in defining the order of execution of events: The script contains two groups: "Group 1 (Radio)" and "Group2 (Checkbox)". I would like the events to run in the following order: "Group 1 (Radio)" = Second Event "Group 2 (Checkbox)" = First Event (main event). Run all selected events after clicking OK button.

Could some friend as a greater knowledge help me?

Thank you. It would be a reversal in the order of running the events of this script:

var w = new Window ("dialog", " My ScriptUI");    w.orientation = "column";         w.alignChildren = "top";  // insert this line 

var g1 = w.add('group')
    g1.orientation = 'row';    var radio_group  = g1.add ('panel', undefined, "Group1");     // Radio        radio_group.alignChildren = "left";        radio_group.add ("radiobutton", undefined, "Radio1");        radio_group.add ("radiobutton", undefined, "Radio2");        radio_group.add ("radiobutton", undefined, "Radio3");     var btnGroup = g1.add("group");           btnGroup.orientation = "column";        btnGroup.alignment = ['left','top'];         btnGroup.add ('button', {x:90, y:125, width:80, height:25}, 'Ok', {name:'ok'});        btnGroup.add ('button', {x:240, y:125, width:80, height:25}, 'Cancel', {name:'cancel'});

var g2 = w.add('group')
    g2.orientation = 'row';    g2.alignment = ['left','top'];     // Checkbox    var check_gp = g2.add('panel',undefined,'Group2');         check_gp.orientation = 'row';         check_gp.alignChildren = ['left','top'];         var check1 = check_gp.add('checkbox',undefined,'checkbox');         check1.value = false; 


// set dialog defaults
radio_group.children[0].value = true;

radio_group.addEventListener('click', function(evt) {
    for (var i = 0, _len = radio_group2.children.length; i < _len; i++) {        radio_group2.children[i].value = false;    }
});


function selected_rbutton (rbuttons) {
    for (var i = 0; i < rbuttons.children.length; i++) {        if (rbuttons.children[i].value == true) {            return rbuttons.children[i].text;        }    }    return false;
} 
 // Linkar com os Scrips.jsx
 if (w.show () == 1) {    var chosenRadioButton = selected_rbutton(radio_group) || selected_rbutton(radio_group2) || selected_rbutton(radio_group3);    switch (chosenRadioButton) {     // Linkar com os Scrips.jsx      case "Radio1":     alert("This is the Radio 1 script");     break;     // Linkar com os Scrips.jsx     case "Radio2":     alert("This is the Radio 2 script");     break;      }

if(check1.value){alert('checkbox (main event)')} 
//else{alert('checkbox 1 is not checked')} 


}

Re: Help with UI: Script execution order when selecting Radio and Checkbox options

$
0
0

UI's are just a way to collect values. The order of what the script does is based on the order you list the processes that are derived from the values in the UI. If you want something to show before something else in the ui, you need to have that line of code first. Same for what the script does once you click the okay button. In the above script you have what the radio buttons do first, so naturally, they're going to display their alert first. There is a part of the script that adds an eventListener. I'm not sure what that's suppose to do. It throws an error for me, and it looks like it tries to set all the radio buttons to false. By nature, if you click on a radio button, other within the same group will turn to false, so I don't know what point that part of the code serves.

apply watemark

Re: Help with UI: Script execution order when selecting Radio and Checkbox options

$
0
0

Hi Chuck Uebele! Our just add the line of code from the first event before! As for the eventListener, I also do not know what it is for, I found this script on the internet, here it does not generate error for me, but I'll eliminate delete it and test, then I go back

Getting average rgb value of an image on photoshop with javascript?

$
0
0

Hi guys. Bare with me but I have no experience with javascript at all and i've been looking up tutorials on how to do this with javascript and a lot of what's coming out has to do with creating a canvas in HTML which isn't possible for the photoshop script i'm doing. I looked at the javascript reference for photoshop cc and saw that there is a Colorsamplertool and I was wondering if this is the way to go? Although i'm not quite sure how this works.


Re: apply watemark

$
0
0

Adobe's supplied Script Image processor can save your image files as jpeg and psd files the script has options to resize and include an action you create in the processing of the files.  Which you can select in the bridge via thumbnails or in Photoshop by filling in the file paths folders where you images are and where the output files should be stored.  The Action you create can add your watermark.

 

There is a better more powerful plug-in Image Processor Pro that you can download from the web and install into Photoshop and the Bridge.  That plug-in is  access via menu File>Automate>Image Processor Pro...  being and Photoshop Plug-in it also supports being recorded in an action itself. However CC 2017 has a problem recording an action that uses the image processor pro plug-in and you you have Image processor Pro include actions in its processing.  You  can be recorded action like that in prior versions of Photoshop. They will still Play in CC 2017.

 

Image Processor Pro can save as many output file for your images as you need to have the size and file format you need them to be. You can have it include your actions processing output files before or after the processor resizes the output document.

 

When using the Image Processor Pro plug-in you can include using the same or a different action for each output file you want created. You can have the image Processor pro use these action(s) before or after you have the processor resize the output documents. You action can simply add a watermark, the Photoshop script does all the other work for you.

 

You should look into the Image Processor Pro plug-in if you want to batch process image files. It can be used from Adobe Bridge via menu Tools>Photoshop>Image Processor Pro, from Photoshop via menu File>Automate>Image Processor Pro... and from Photoshop actions.

 

Capture.jpg

Re: Getting average rgb value of an image on photoshop with javascript?

$
0
0

Perhaps it would be better if you try to describe what it is that you want to do.Use your own words do not try to use any Photoshop terms like Photoshop script  or use web technology like HTML.  Don't talk javascript you do not know it.  Describe what it is that you want to be able to do.

Re: Help with UI: Script execution order when selecting Radio and Checkbox options

$
0
0

In order for the checkbox alert to run first, I understood that I have to put above the code lines of the radio buttons: To work correctly, what line should I add this event to?

If (check1.value) {alert ('checkbox (main event)')}

I put in line 31 but it did not work:

Chuck Uebele Please, would you have any idea? It's not easy for me.

Would you have a simple and small example of yours for the same purpose? Thank you

Re: Getting average rgb value of an image on photoshop with javascript?

$
0
0

Basically, I want to make a photoshop script that will change the color of a text in a text layer depending on  how light or dark the background image is. I figured that to achieve this I would need to get the rgb values of the background image and when I was searching around people mentioned something about the color sampler tool that photoshop has.

Re: Getting average rgb value of an image on photoshop with javascript?

$
0
0

Resize the to 1px x 1px with interpolation turned on then check the rgb value of that pixel. It's the simplest thing I can think of so give it a try and let us know how it works out.

Viewing all 27456 articles
Browse latest View live


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