Skip to main content
11 votes
Accepted

InDesign: how to remove everything between square brackets

You don't need to script this, just hit Ctrl+F and switch to the 'GREP' tab type \[[^]]*\] in the 'Find what' field or type the same thing with an \s? added in front to also remove any preceding ...
Lucian's user avatar
  • 29.4k
5 votes
Accepted

Exporting SVG paths to HTML to animate with JavaScript

If your goal is to access the SVG from your HTML (e.g. to animate with JavaScript or style with CSS) then you do need to use the SVG inline (as in paste the raw SVG code in the HTML), if you use your ...
Cai's user avatar
  • 40.7k
4 votes
Accepted

What is the difference between .jsx and .js?

The scripting engine Adobe uses is called ExtendScript which is a dialect of JavaScript, or more accurately EcmaScript. There are many dialects of JavaScript with different libraries around, and some ...
joojaa's user avatar
  • 58.1k
4 votes

How to script a popup box before closing a document - InDesign

Edit: Here is a script that asks for confirmation before closing a document: #target Indesign #targetengine "closeConfirmation" app.addEventListener("beforeClose", confirmClose); function ...
mdomino's user avatar
  • 992
4 votes

Photoshop/Javascript - Will this code help me draw fronts on weather maps?

No this script snippet does nothing for photoshop, atleast its impossible to say anything without knowing what the functions do. Not all javascript is geared to work with Photoshop API so something ...
joojaa's user avatar
  • 58.1k
4 votes

InDesign Script to create URLs

It is a built-in feature. Open the Hyperlinks panel and select "Convert URLs to Hyperlinks..." in the panel menu:
Wolff's user avatar
  • 21.2k
4 votes
Accepted

Explanation of a function line by line for learning purposes!

// make new function named getAllShapeLayersData function getAllShapeLayersData() { // make empty list lyrs (for returning later) var lyrs = []; //if the thing in try fails go to catch ...
joojaa's user avatar
  • 58.1k
3 votes

How to rotate all items as a group? (In a script, Illustrator)

Quick primer into computer graphics programming. Whenever you are trying to do a compound transform it is best to compose the transform onto a matrix operation. Mainly because you can specify a ...
joojaa's user avatar
  • 58.1k
3 votes

How to draw high-resolution images on client-side?

None. No browser can display more than an 8 bit color per channel in 0-255 range. No affordable monitor can actually display more than 10-12 bits of color per channel, most if not all consumer ...
joojaa's user avatar
  • 58.1k
3 votes

Logarithmic Spacing in Illustrator

#target illustrator function log10(val) { return Math.log(val) / Math.LN10; } docRef=app.activeDocument; for (var i = 1; i <= 20; i++) { var pointTextRef = docRef.textFrames.add(); ...
joojaa's user avatar
  • 58.1k
3 votes

Is it acceptable as a web developer to know very elementary JavaScript and rely on frameworks such as Materialize?

As a web developer you really should know at least the basics of JavaScript. You can achieve a lot of visual effects purely with CSS but there is a lot you can do with JavaScript that simply can't be ...
Cai's user avatar
  • 40.7k
3 votes

How do I position an InDesign object using Javascript?

Here is a proposal: var main = function() { var doc = app.properties.activeDocument, today = (new Date()).getDate(), found, x1, x2, y1, y2; if ( !doc ) return; app....
Loic's user avatar
  • 701
3 votes

How do I position an InDesign object using Javascript?

Yes, it is possible to position an InDesign object via scripting. First you need to somehow adress the oval, so you can later move it. If it is the only oval on the spread you can use var myOval = ...
mdomino's user avatar
  • 992
3 votes
Accepted

How can I get all shape layers where their names include specific word?

Photoshop uses ancient JS engine, something like ES3, so there's no .include(). You can use String.indexOf() instead: if (lyr.name.indexOf("Stitches") !== -1) { //"Stitches" is found in the name }...
Sergey Kritskiy's user avatar
3 votes

How to select or copy all text in InDesign document

Go to Utilities → Scripts → Javascript → Export All Stories, right click, hit Run, choose Text or RTF, hit OK.
Lucian's user avatar
  • 29.4k
2 votes

Website Designs with Round Headers?

Probably the best approach is to play around with Clippy which will help you with the shape you are looking for and neatly output the CSS for you. Then it's just a case of tweaking and integrating ...
dotschko's user avatar
2 votes
Accepted

Vector Format Perlin Noise Effect

If you want to go the JS/CSS route: One approach would be to use a technique similar to Dietrich Featherston's code found here: http://bl.ocks.org/d2fn/0d3789278f3d9816e0fd In Featherston's code, ...
AndrewUlrich's user avatar
2 votes
Accepted

Photoshop javascript, how to select contents of a layer

Here's a function that uses scriptlistener code to select all the pixels in the current layer function selectLayerPixels() { // ======================================================= var id710 = ...
Ghoul Fool's user avatar
2 votes

How to insert text into an Illustrator file using ExtendScript JavaScript

I suppose you're following the tutorial from https://github.com/jtnimoy/scripting-for-illustrator-tutorial You need to define the document you want to write your text into. Instead, your code is ...
Luciano's user avatar
  • 8,045
2 votes
Accepted

Break SVG file into multiple files

SVG is merely a collection of XML data. Like any XML data, it can be broken apart and separated. The ease of separating things depends a great deal upon original construction and available tools. ...
Scott's user avatar
  • 210k
2 votes

Script to change a color in all layers of a PSD file to another color?

Using JavaScript Adobe's scripting interface. Changing text colour A to X is straight forward (provided you have no groups than it get a bit more complex): var colourA = "28bd98"; var ...
Ghoul Fool's user avatar
2 votes
Accepted

Search for string and delete entire text frame with JavaScript for Illustrator

This will do it so long as there is a consistent piece of text to search for. Can be applied to an action and batched. Notice that it loops in reverse order. This is a common strategy whenever ...
Nick Combs's user avatar
2 votes

How to assign and execute a custom JavaScript function to a button on InDesgin?

As of the time of posting, it is still impossible to call a custom JavaScript function from InDesign (unfortunately). You need to create the button in ID and then, after the PDF has been exported, use ...
Mike Mitchell's user avatar
2 votes
Accepted

Indesign - remove empty cells from table

As mentioned in a comment, the empty rows that are not found by the script are those that are in a table nested in its entirety inside a larger table. The script logic does not see them; it only ...
Jongware's user avatar
  • 4,238
2 votes
Accepted

How do I set eyedropper settings using Photoshop ExtendScript (Javascript)?

Based on some googling, it sure doesn't seem like it's directly possible. However, you can use scripting listener/action manager to change the tool preset. So... maybe you could make a tool preset ...
Joonas's user avatar
  • 15.5k
2 votes

How do I set eyedropper settings using Photoshop ExtendScript (Javascript)?

To get a current setting of an eyedropper (switch to eyedropper first using Joonas' selectTool()): //returns 0 for Point Sample, 1 for 3x3, etc function getCurrentEyedropperSetting() { var ref = ...
Sergey Kritskiy's user avatar
2 votes
Accepted

Scripting 1-line vs 2-line text boxes

The best I could come up with was this: After new text is applied... Check layer height Turn on "No Break" Remove all "\r" Check layer height again If layer height is now less than it was before = ...
Joonas's user avatar
  • 15.5k
2 votes

Acrobat - placeholder text for form field?

// On Focus script: event.target.value = ""; event.target.textColor = color.black; // On Blur script: if (event.target.value=="") { event.target.value = "Company&...
Nishma Maskey's user avatar
2 votes

InDesign: building charts in EPS or Javascript

Don't try EPS, but use specialized software to do this. There are specialized programs such as GraphViz, but even Microsoft Excel should be able to draw such simple bar graphs. You cannot use any and ...
Anonymous's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible