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 ...
user avatar
  • 27.5k
6 votes
Accepted

InDesign script to list hyperlinks in active document

More than one error there, I'm afraid. "Hyperlink" is not covered in the latest version of Adobe's own Scripting guide (which would be "Adobe InDesign CS6 Scripting Guide: JavaScript" on http://www....
user avatar
  • 4,168
5 votes
Accepted

Script to automatically snap all points to grid in Adobe Illustrator?

Here you go, make sure the paths that you want to snap are selected: // jooSnapToDocumentGrid.jsx #target illustrator main(); function main(){ var grid = getDocumentGrid(); ...
user avatar
  • 55.3k
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 ...
user avatar
  • 39.9k
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 ...
user avatar
  • 55.3k
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 ...
user avatar
  • 984
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 ...
user avatar
  • 55.3k
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:
user avatar
  • 19k
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 ...
user avatar
  • 55.3k
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 ...
user avatar
  • 55.3k
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....
user avatar
  • 691
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 = ...
user avatar
  • 984
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 ...
user avatar
  • 39.9k
3 votes
Accepted

How to convert an array of HTML colours into into a picture?

It’s a few lines in Python: from PIL import Image import numpy A = […] convert = lambda string: [int(string[i:i+2],base=16) for i in (1,3,5)] B = numpy.array([map(convert,line) for line in A], ...
user avatar
  • 14.3k
3 votes

How to convert an array of HTML colours into into a picture?

You can do this easily using the <canvas> element and some JavaScript... A is already in JS format! var canvas = document.querySelector("canvas"), // Select our canvas element ctx = canvas....
user avatar
  • 12.9k
3 votes

Alternatives to jQuery for simple, backwards compatible, client-side website animations?

Your question is an incredibly broad one. The best animation library for your project is dependent on what you're doing in that specific project. The optimal library would be a custom one designed ...
user avatar
  • 12.9k
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(); ...
user avatar
  • 55.3k
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 ...
user avatar
  • 55.3k
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 }...
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.
user avatar
  • 27.5k
2 votes

Long Shadow Effect in SVG for Web

You can use SVG filters. I am just not sure its any lighter in terms of speed. Having 75 paths is nothing to the computer, but even a few filters can take the computer to its knees. (this is highly ...
user avatar
  • 55.3k
2 votes

Long Shadow Effect in SVG for Web

I’ve seen CSS examples where multiple drop shadows of varying offsets and colours are used (usually with box-shadow). You could do the same using shadows in an SVG. Here’s a CSS example: http://www....
user avatar
2 votes
Accepted

Indesign script to replace paragraph style

Okay, I finally figured out the answer myself and am posting it here for the benefit of others. The trick is to call the remove method of the ParagraphStyle class (more accurately, the paragraph style ...
user avatar
2 votes
Accepted

InDesign row height script?

I found that globally changing tables is not something that Table and Cell Styles do very good. Apart from the ever-present problem that "cell styles just don't take" (something I've always wondered ...
user avatar
  • 4,168
2 votes
Accepted

Indesign script (Javascript) to return/select words around insertion point

This is a tricky problem. I found "TransposeTwoCharacters.jsx" by Keith Gilbert (here) and took some logic from him. This should work for you. // based on // TransposeTwoCharacters.jsx // by // ...
user avatar
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 ...
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, ...
user avatar
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. ...
user avatar
  • 197k
2 votes
Accepted

What is a Type 1 font in InDesign?

Type 1 is Adobe's old format. It was introduced in 1980's at the same time than the PostScript language. Type 1 fonts have Bezier curve outlines and utilize PostScript. Type 1 supports hinting. Many ...
user avatar
  • 50.9k
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 ...
user avatar
  • 7,806

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