Highlighted

Droplets using Photoshop javascript

New Here ,
Aug 14, 2020

Copy link to clipboard

Copied

Hi

 

I want to create a droplet that does some function and returns the image back to the calling application, in this case I'm using captureOne 20. Im using Photoshop CC 2020 21.2.1

 

There are some functions which captureone does not have and I want to use photoshop such as adding borders and watermark over the border. I created a javascript which is called when I run the export function in captureone. the image should export in jpeg, load in photoshop run the javascript and back to captureone for further processing. 

 

I am facing an issue, that is in photoshop, I am prompted for save as instead of just closing the file and sending it to captureone. I'm posting the code here for reference please help

 

 

[quote]

var doc = app.activeDocument

var docResolution = doc.resolution  //given in px per inch

var docWidth =  new UnitValue (doc.width.as("px"), "px")

var docHeight =  new UnitValue (doc.height.as("px"), "px")

 

var mycolor = new SolidColor();

mycolor.rgb.hexValue = "ffffff";

app.backgroundColor = mycolor;

doc.resizeCanvas(docWidth*115/100, docHeight*115/100, AnchorPosition.MIDDLECENTER)

 

var artLayerRef = doc.artLayers.add()

artLayerRef.kind = LayerKind.TEXT

artLayerRef.name = "watermark"

 

textRef = artLayerRef.textItem

textRef.contents = "watermark"

textRef.size = new UnitValue(23, 'px')

textRef.color.hexvalue = "232323"

textRef.kind = TextType.POINTTEXT

textRef.font = "Verdana"

 

doc.save() // This one prompts save as which stops the captureone process

doc.close() // further the again prompts to save the file in PSD format

[/quote]

TOPICS
Actions and scripting, How to, Mac

Views

54

Likes

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

Droplets using Photoshop javascript

New Here ,
Aug 14, 2020

Copy link to clipboard

Copied

Hi

 

I want to create a droplet that does some function and returns the image back to the calling application, in this case I'm using captureOne 20. Im using Photoshop CC 2020 21.2.1

 

There are some functions which captureone does not have and I want to use photoshop such as adding borders and watermark over the border. I created a javascript which is called when I run the export function in captureone. the image should export in jpeg, load in photoshop run the javascript and back to captureone for further processing. 

 

I am facing an issue, that is in photoshop, I am prompted for save as instead of just closing the file and sending it to captureone. I'm posting the code here for reference please help

 

 

[quote]

var doc = app.activeDocument

var docResolution = doc.resolution  //given in px per inch

var docWidth =  new UnitValue (doc.width.as("px"), "px")

var docHeight =  new UnitValue (doc.height.as("px"), "px")

 

var mycolor = new SolidColor();

mycolor.rgb.hexValue = "ffffff";

app.backgroundColor = mycolor;

doc.resizeCanvas(docWidth*115/100, docHeight*115/100, AnchorPosition.MIDDLECENTER)

 

var artLayerRef = doc.artLayers.add()

artLayerRef.kind = LayerKind.TEXT

artLayerRef.name = "watermark"

 

textRef = artLayerRef.textItem

textRef.contents = "watermark"

textRef.size = new UnitValue(23, 'px')

textRef.color.hexvalue = "232323"

textRef.kind = TextType.POINTTEXT

textRef.font = "Verdana"

 

doc.save() // This one prompts save as which stops the captureone process

doc.close() // further the again prompts to save the file in PSD format

[/quote]

TOPICS
Actions and scripting, How to, Mac

Views

55

Likes

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
Aug 14, 2020 0
Adobe Community Professional ,
Aug 14, 2020

Copy link to clipboard

Copied

Try:

 

doc.close(SaveOptions.DONOTSAVECHANGES)

Likes

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
Reply
Loading...
Aug 14, 2020 0