Skip to main content
Inspiring
January 8, 2024
解決済み

Running an action via scripting with options

  • January 8, 2024
  • 返信数 2.
  • 418 ビュー

Hi. Out of interest I'm trying to set some options when running an action via a script, specifically suppressing the action dialog via script. - Not displayDialogs = DialogModes.NO

 

var theFiles = ["D:\\temp\\jp.jpg"];

// MAIN SCRIPT CODE TO DO STUFF...
var act = "make_layer"
var actset = "my_action_set";

var batchOptions = new BatchOptions();
batchOptions.overrideOpen = false;
batchOptions.overrideSave = false;

// app.doAction(act, actset);
app.batch (theFiles, act, actset, batchOptions)

 

I get the error illegal argument on app.batch (theFiles, act, actset, batchOptions);  - not very helpful. Not sure where I'm going wrong as 

app.doAction(act, actset);

 works fine.

 

Any ideas??

 

このトピックへの返信は締め切られました。
解決に役立った回答 c.pfaffenbichler

A String is not directly a File, please try 

var theFiles = [File("D:\\temp\\jp.jpg")];

 

返信数 2

Stephen Marsh
Community Expert
Community Expert
January 8, 2024

I have seen this in the documentation, however, I don't recall seeing any scripts using Batch before!

 

EDIT:

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-run-photoshop-batch-via-javascript-vs-manually-selecting-all-attributes/m-p/14347697#M774613

c.pfaffenbichler
Community Expert
Community Expert
January 8, 2024

A String is not directly a File, please try 

var theFiles = [File("D:\\temp\\jp.jpg")];

 

Ghoul Fool作成者
Inspiring
January 8, 2024

D'oh! Thank, man.