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
1 answer

Exporting InDesign tables to Excel

I have been testing out the below script which works in its ability to select the first table within an InDesign document and export its contents to Excel. // By Trevor www.creative-scripts.com (coming sometime) Custom and Readymade scripts for…
Matt Cass
  • 29
  • 1
  • 8
2
votes
2 answers

Select all text frames and ALIGN RIGHT in all ODD numbered pages of InDesign (Javascript)

I want to select all text frames and then ALIGN its content to the right of the page of all the ODD numbered pages of my document in InDesign using only Javascript. here's my progress so far and I know I can determine the odd numbers but still…
2
votes
1 answer

How to create a text box in After Effects using ExtendScript?

I'm trying to create a text box in after effects using extendscript, like the text box when you use the text tool and click and drag a box. Every resource I can find only shows how to make an actual box around text, but I just want the text box so…
2
votes
1 answer

Why are Extendscript objects invalidated when created inside a function?

function addControl(layer, name){ newCtrl = layer("Effects").addProperty("Slider Control"); newCtrl.name = name; return newCtrl; } var Slider1 = addControl(ExistingLayer, "slider 1"); $.write(Slider1.name); var Slider2 =…
Kez
  • 61
  • 1
  • 7
2
votes
1 answer

Photoshop script to split text layer into words

Using Photoshop 2017, I am splitting a text layer into words: Using the following script: psd = app.activeDocument; layer = psd.activeLayer; var text = layer.textItem.contents; var textArray = text.split(" "); var lngth = textArray.length+1; for…
friendlygiraffe
  • 871
  • 2
  • 6
  • 18
2
votes
1 answer

Writing binary file using in Extendscript. Incorrect file size

Further to my question here I'm writing a list of hex colours to a binary file from within Photoshop using Extendscript. So far so good. Only the binary file written with the code below is 119 bytes. When cut and pasted and saved using Sublime Text…
Ghoul Fool
  • 6,249
  • 10
  • 67
  • 125
2
votes
2 answers

Using ExtendScript in Sublime Text editor

I am trying to set up photshop Scripting environment in my preferred IDE. So I am using the excellent Davide Barranca's Package for Sublime found HERE. I've installed the package and have ticked ExtendScript-PS option found under Tools > Build…
2
votes
1 answer

InDesign Script not working when dialog window is added

I am trying to create a script based on GREPs that replaces fonts in non-latin characters with a compatible font, but when I add it to a dialog window it does not work anymore (it works by itself). I have identified the point where it stops running…
2
votes
3 answers

When adding a Document in Adobe Illustrator's Extendscript is there a way to set it's name?

Everytime I run my script and add a document the default filename is "Untitled-x*". I would like to be able to provide a default name for the document. Is there a way to do this using Extendscript? Here is how I'm adding a Document currently: var…
Chad
  • 1,708
  • 1
  • 25
  • 44
2
votes
1 answer

Executing ExtendScript from AppleScript in InDesign 2020

I'm trying to open and execute a JSX script via AppleScript with do script command as described in Adobe InDesign Scripting Guide on this page and elsewhere on the interwebs: The do script method gives a script a way to execute another script. The…
ALx
  • 611
  • 9
  • 24
2
votes
3 answers

Inaccurate values when converting from RGB to L*ab colours

I'm trying to convert sRGB values (in Photoshop) to L*ab values (also for use in Photoshop) I'm in the ballpark, but not getting the same results as EasyRGB which is where I got the conversion formulas from. I expect there's rounding errors (not at…
Ghoul Fool
  • 6,249
  • 10
  • 67
  • 125
2
votes
1 answer

Photoshop Javascript get selected pathItem?

My dilemma lays in the pathItems (not the file path, but those vector paths in the tab next to the layers). I want my script to react to which one of several paths is currently selected. Is there any way to get the index or name of the currently…
morph3us
  • 220
  • 1
  • 3
  • 13
2
votes
1 answer

Photoshop CEP: JSX Object to JS

I'm running into an issue with sending data from JSX to JS using evalScript in Photoshop. In the following example I attempt to send the document width, height and ruler units within an object, docInfo, back to my CEP Panel JS. The issue is that…
davevsdave
  • 264
  • 2
  • 15
2
votes
0 answers

Is there a way to call an existing shortcut in Premiere Pro through extend script?

I'm busy building some automation scripts for Premiere Pro CC 2019 and would like to do a few things that appear not to have methods as described in the API documentation found here:…
2
votes
2 answers

Is there any 'document.getElementById' equivalent in Extendscript or Javascript for Photoshop?

I've got some code with the ScriptListner plugin for Photoshop. I'm trying to use the "document.getElementById('id').path = 'some path'" with ExtendScript, which is actually just modified JavaScript (as far as I know) but Photoshop JavaScript engine…