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

Droplets using Photoshop javascript

New Here ,
Aug 14, 2020 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

Views

230

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

Copy link to clipboard

Copied

LATEST

Try:

 

doc.close(SaveOptions.DONOTSAVECHANGES)

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