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
2
votes
5 answers

Calculation result wrong in Extendscript Javascript

I'm writing a InDesign Script and I'm using moments.js for calculating dates. When I'm using the date-format "Do", which should return fore example "1st, 2nd, 3rd, 4th...", but the calculation the function does, returns a wrong result and the result…
der-lukas
  • 936
  • 9
  • 13
2
votes
1 answer

Schroedinger's object?

I tried to check, if an object (or layer) does exist in a document. This script works, if there is a pageItem with name x. But it fails if not. (so far so good) The strange part is: even if this object named "x" doesn't exist, A returns an object.…
mayzoon
  • 25
  • 5
2
votes
0 answers

Switching panels in Adobe After Effects using Extendscript

In After Effects I have written a panel that (among other things) switches between different compositions using Extendscript. I use the myComp.openInViewer() function to switch between compositions. A side effect of this function is that the viewer…
2
votes
1 answer

Getting the geometric bounds of a piece of text

I have an InDesign document which has hyperlinks contained inside a text frame. I need a way to determine the geometric bounds of the text contained in the hyperlink. Unfortunately, I can't seem to find a way to do this in ExtendScript. // Export…
Pieter Claerhout
  • 348
  • 4
  • 11
2
votes
2 answers

How to remove a (sub)menu and all its traces of existence?

Using the code #targetengine "mine" var mainmenu = app.menus.items("$ID/Main"); var menu = mainmenu.submenus.add("Test"); I added a submenu to InDesign's menu, that I later removed via menu.remove(); delete menu; Unfortunately, when I try to…
Tobias Kienzler
  • 25,759
  • 22
  • 127
  • 221
2
votes
1 answer

Adobe InDesign JavaScript XML: How to add XML structure tags programmatically?

This code references the root XML node, adds a FirstXMLObject under it, then adds a few fields under FirstXMLObject: var myXMLroot = mydocument.xmlElements.item(0); // The root always exists var b = myXMLroot.xmlElements.add(…
Zachary Scott
  • 20,968
  • 35
  • 123
  • 205
2
votes
1 answer

How to get letter width?

I'm working on an Illustrator script (javascript) and I need to measure the width of a letter. This letter is a TextFrameItem with only one character: The object has an attribute .width which gives the width of the bounding box above. The length I…
superrache
  • 650
  • 11
  • 26
2
votes
1 answer

Adobe Extendscript Toolkit: Illustrator and Intellisense

I'm using Illustrator CC 2015 and ExtendScript Toolkit 4.5.5. I'm scripting in javascript and intellisense/auto completion is not working. I've selected the target application as Adobe Illustrator CC 2015, as well as enable auto complete in…
ekatz
  • 1,050
  • 1
  • 11
  • 29
2
votes
1 answer

How to select and delete every clipping masks in an Illustrator document using javascript?

I'm making extend scripts for Adobe Illustrator CS6 (javascript) and I need to delete every clipping masks of a document. I already have a solution but it's not fast enough in big documents. Here is my code: var releaseClippingMasks =…
2
votes
1 answer

Can't target applications in Adobe's ExtendScript Toolkit CC

The usual way of targeting applications is no longer functional for me, which is a known bug of the program: . One solution that has worked for others is to include a #target directive in the code, as shown here. However, when I try the same, I get…
PCBlue22
  • 21
  • 1
  • 2
2
votes
1 answer

extendscript: get folders of Project

I want to read all subfolders of my current Project. Because my Project is using images from the Footage-Folder i need all the sub-Folders of it. For now i only have the current Path of my project: var projectPath=app.project.file.path;
dazzafact
  • 2,570
  • 3
  • 30
  • 49
2
votes
1 answer

How do I set http headers in Adobe Illustrator ExtendScript when using the BridgeTalk HttpConnection object?

I am trying to make http post requests from within Illustrator ExtendScript (via BridgeTalk) and for the most part it is working. However, the documentation on using HttpConnection is non-existent and I am trying to figure out how to set…
romiem
  • 8,360
  • 7
  • 29
  • 36
2
votes
2 answers

InDesign extendScript: How do I transform the entire selection?

By using the simple array app.selection[x], you can apply a transformation to any object in the selection, independently. But how do I apply a transformation to the entire selection together? For example: inside InDesign, I can select two…
user1971419
2
votes
3 answers

Javascript parsing?

I'm coding something in extendscript for adobe after effects, which ends up being javascript. I have an array and I would like to do a search for just the word "assemble" and return the whole jc3_RIG_008_masterLayer assemble string var comps =…
2
votes
3 answers

Accessing paragraphs added via Javascript

I have a paragraph and after this paragraph, I'd like to add another paragraph. I'm doing this using myPara.contents += "\r". I need this second paragraph to be a different style than the original paragraph. They problem is I cannot seem to get…
jorbas
  • 311
  • 1
  • 10