• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Duotone selection script

Explorer ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

Does anyone know if you can recreate the duotone color selection in a script? I want to have it in my image processing script 

 

Thanks!

Screen Shot 2020-05-10 at 7.52.32 PM.png

TOPICS
Actions and scripting , macOS , SDK

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 11, 2020 May 11, 2020

I think that you misunderstood my post.

 

It is available to scripting, just via Action Manager code recorded via the Scripting Listener plug-in that writes JavaScript to a log file. The result of converting an action to script results in similar "more complex" code as found in the 2nd example below.

 

Take the following example of "simple" standard "DOM" code as found in the JavaScript reference to invert the colours of an image:

 

 

app.activeDocument.activeLayer.invert();

 

 

Compared to "mor

...

Votes

Translate

Translate
Adobe
Community Expert ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

Yes, however, you will need to record this using the Scripting Listener plug-in as I don't believe that this is available via standard DOM code:

 

https://blogs.adobe.com/crawlspace/2006/05/installing_and_1.html

ScriptingListener plug-in

 

Or record an action, then convert the action to a script via xtools:

 

xtools / v2.3

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

that's disappointing it's not accessible via script. Actions to script seems interesting though

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

I think that you misunderstood my post.

 

It is available to scripting, just via Action Manager code recorded via the Scripting Listener plug-in that writes JavaScript to a log file. The result of converting an action to script results in similar "more complex" code as found in the 2nd example below.

 

Take the following example of "simple" standard "DOM" code as found in the JavaScript reference to invert the colours of an image:

 

 

app.activeDocument.activeLayer.invert();

 

 

Compared to "more complex" action manager code recorded by Script Listener to perform the same process:

 

 

var idInvr = charIDToTypeID("Invr");
executeAction(idInvr, undefined, DialogModes.NO);

 

 

Or a more "user friendly" version of AM code from the Clean SL script:

 

 

invert();
function invert() {
	var s2t = function (s) {
		return app.stringIDToTypeID(s);
	};
executeAction(s2t("invert"), undefined, DialogModes.NO);
}

 

 

In many cases, the "more complex" AM code runs faster than the "simpler" code available in the JavaScript reference guide. For duotone mode, it's a moot point anyway, unless I'm mistaken, there is no way to do this using the "standard" code in the JavaScript reference guide.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

LATEST

Ah, I see!

 

I'll give it a try using ScriptListener, thanks for clarifying. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

Just out of curiosity: Are the images actually going to be printed with spot colors? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

Yes, I work in pre-press for publishing. We sometimes have clients with purely duotone images, and would love to speed up the process

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines