Questions tagged [extendscript]

ExtendScript is one of the scripting languages available for implementing custom functionality for Adobe products like Photoshop, Illustrator, etc. ExtendScript is based on, and has been kept locked specifically to, ECMAScript 3 (released in 1999).

ExtendScript, or JSX (not to be confused with React's JSX markup) is a scripting language based on ECMAScript 3 (1999) used for scripting custom functionality in Adobe products like Photoshop, Illustrator, etc.

It is syntactically equivalent to JavaScript 1.5, with the same standard library, as well as a custom API for interacting with Adobe product applications and documents.

ExtendScript does not support any language features or standard library functions that were introduced after ECMAScript 3.

930 questions
9
votes
3 answers

Saving per-user or per-document preferences in a Photoshop script

I'm working on a Photoshop script in JavaScript using ExtendScript. My script allows some user input, and I'd like to save it between uses. That is, I'm looking for a way to save a simple string or numeric value under a particular key so that I'll…
Dave Feldman
  • 104
  • 1
  • 9
  • 28
9
votes
2 answers

What is #targetengine?

My only prior experience with #targetengine is when I've used #targetengine "session"; to turn a dialog into a palette when scripting in InDesign. But as I'm trying to figure out how to script a menu, I'm starting to see it pop up being used in…
Brendan
  • 868
  • 1
  • 16
  • 38
8
votes
0 answers

Photoshop batch-apply 'Last Filter' works for every filter EXCEPT Liquify

This script takes the last filter that was applied and repeats it on all selected layers and masks. (It is designed to avoid the need to collapse layers into a smart object in order to batch-apply filters). However, there's a bug in it that I can't…
8
votes
3 answers

How to check if a property value is readonly using extendscript?

I'm writing a script for After Effects that collects all properties from a layer and write them into an XML file. When I retrieve the values from the XML, some values are readOnly and the toolkit throws an error. Is there any way to check it, like…
Miguel
  • 709
  • 7
  • 21
8
votes
3 answers

How do I create a folder using ExtendScript?

This seems like it would be a very easy problem to solve, but I've been banging my head against it for almost an hour. All I need is a snippet of javascript/extendscript code so that my InDesign CS6 script can create a folder. I know the existing…
7
votes
2 answers

add variable to array in a loop

using extend script to push a variable into an array it's basically javascript. any idea what I am doing wrong? if ( app.documents.length > 0 ) { for ( i = 0; i< app.activeDocument.textFrames.length; i++) { var allSizes = []; //set up…
Lukasz
  • 926
  • 3
  • 14
  • 22
7
votes
1 answer

Manipulating text in a TextBox in Adobe InDesign CS5

How can I do some manipulations with the text in a TextBox on resize in Adobe InDesign CS5? The main goal is too split the last word on every row to achieve something like a custom hyphenation. Is it possible using JavaScript (or ExtendScript?)…
hgulyan
  • 8,099
  • 8
  • 50
  • 75
7
votes
2 answers

Collapse or Expand a Layerset in Extendscript

I created a extendscript that automatically creates layersets for asset textures for a game. After creating a layerset, the set is expanded by default. I want the layerset to be collapsed as shown in the picture below. I leave only the Diffuse layer…
Nique
  • 543
  • 7
  • 21
7
votes
2 answers

Adobe After Effects extend script - how to run script from command line and pass in arguments?

I'm trying to run an Adobe AE extendscript from the command line. I use the "-r" argument and I can run scripts fine. However, is it possible to pass in an argument to the script? Like, if i run this from the command line: C:\>"C:\Program…
ygetarts
  • 923
  • 3
  • 14
  • 29
7
votes
2 answers

Adobe ExtendScript debugging

There's a dearth of info in the supporting PDFs and on the web. I happened to come across a post in a blog that mentioned that $.write() or $.writeln() will write a string to the javascript console. Quite useful. Does anyone know if this $ object…
lenrussell
  • 109
  • 1
  • 3
7
votes
4 answers

Can Adobe .jsx scripts include other script files?

We're writing a bunch of .jsx scripts and in each I have to mock out some functions so I can use things like Array.map() and String.trim(), but I don't want to have to include that code at the top of every script. Is there a way to "include" other…
rhodesjason
  • 4,904
  • 9
  • 43
  • 59
7
votes
2 answers

How to call a python or shell script from within Extendscript?

I have a python script that needs to be called from within an Extendscript script. Is there any library function available which can do this? I tried finding a solution in the documentation and many other online resources but nothing has worked for…
6
votes
1 answer

Function to show/hide layer with Photoshop script (JSX)

I am writing a script that will loop through layers, trim them and export. So far I have most of all the element I need to complete this script. The only thing I can't find is how to show/hide an individual layer. I've found functions to show/hide…
Sebastien
  • 2,607
  • 9
  • 30
  • 40
6
votes
2 answers

How can I tell typescript to include a line verbatim in js without parsing it

I’m writing an app in typescript to compile to adobe extendscript (an es3-based javascript syntax). I am trying to use the extendscript-only syntax #include "path_to_file"; which is not valid typescript (and not even valid javascript). I would like…
tbrugere
  • 755
  • 7
  • 17
6
votes
2 answers

How can I use higher order functions like Array.reduce() in an Indesign script?

I've started a project where I need to use Adobe Indesign and ExtendScript to programmatically extract some data from a series of INDD files. The version of Javascript used for scripting in these programs doesn't support any of the higher order…
Jack Steam
  • 4,500
  • 1
  • 24
  • 39
1
2
3
61 62