11

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 whitespace, otherwise you'll be left with double spaces. so that's \s?\[[^]]*\] make sure the 'Change to' field is empty click 'Change All'


6

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.adobe.com/devnet/indesign/documentation.html), but that's no reason to just 'try' things. The ExtendScript Toolkit Editor has a Help of its own – the "Object ...


5

How you receive content from designers will control what is and is not relevant. If you receive merely static images for layout which you must then translate to HTML/CSS/JS there's nothing you need to explain to the designers. If you control all the markup and designers aren't creating markup, nothing changes for them. The only possible caveat is if you ...


5

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 SVG with an <img> tag or as a CSS background-image then you can't access the SVG's DOM from your HTML document. The easiest way to include your file, if ...


4

Here you go, make sure the paths that you want to snap are selected: // jooSnapToDocumentGrid.jsx #target illustrator main(); function main(){ var grid = getDocumentGrid(); snapSelectedPathToDocumentGrid(activeDocument.selection, grid); } function snapSelectedPathToDocumentGrid(sel, grid){ for(var i = 0; i < sel.length; i++){ ...


4

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 unique preprocessor statements. ExtendScript has a number of libraries not available elsewhere. JavaScript has certain base features that makes them similar and ...


4

Edit: Here is a script that asks for confirmation before closing a document: #target Indesign #targetengine "closeConfirmation" app.addEventListener("beforeClose", confirmClose); function confirmClose(e) { if(e.parent.constructor.name !== "LayoutWindow") return; if (confirm ("Did you proof your page?") === false) { e.stopPropagation(); e....


4

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 meant to work in a browser does not work in phostoshop. On the otherhand Illustrator is far more suitable for this task and can do this all out of the box, no ...


4

It is a built-in feature. Open the Hyperlinks panel and select "Convert URLs to Hyperlinks..." in the panel menu:


4

// 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 try { // get the background layer activeDocument.backgroundLayer; var layers = 0 } catch (e) { // Ok so there was no ...


3

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 monitors out there have an 8 bit limitation. So you have no option other than somehow precondition the image. I am essentially missing the point of Landsat ...


3

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.findGrepPreferences = null; app.findGrepPreferences.properties = { findWhat : "^"+today+"$", pointSize:24 }; found = doc.findGrep(); if ...


3

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 = app.activeWindow.activeSpread.ovals.firstItem(); to save the oval in the variable myOval. Afterwards you can just use myOval.move([x, y]); to move the oval ...


3

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 done with CSS. Where JavaScript really comes in to play is adding functionality and interactivity. Try turning JavaScript off and using this site and you'll ...


3

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 specifically for the project, but of course that doesn't answer your question here. The two best general JavaScript animation libraries in my opinion at the ...


3

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], dtype=numpy.uint8) image = Image.fromarray(B, mode="RGB") image.save("image.png") A short explanation: convert is a function that converst an HTML colour string (...


3

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.getContext("2d"), // Save the context we're going to use width = A[0].length, // Get the width of the array height = A.length, // Get the height of the ...


3

#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(); pointTextRef.contents = "Text #"+i; pointTextRef.translate(10,400*log10(i)); };


3

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 complex transformation in one go. OK so no we have to compute the bounds. But then you might rotate around a arbitrary point in some case too (this makes it easy). #...


3

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 }


3

Go to Utilities → Scripts → Javascript → Export All Stories, right click, hit Run, choose Text or RTF, hit OK.


2

It would really depend on the particular framework. AFAIK, Angular.js isn't really a UI framework in that it's up to you to design the actual user interactions and UI visuals. In general, though, you'd likely want your designers to: understand any page layout grid structures the framework provides. understand any built in UI components. Specifically how ...


2

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 about), there are just too many things that you cannot do with Cell Styles. So I've relied on scripting to format my tables for a long time now. I have a basic ...


2

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 being removed). The syntax is: Old_Style.remove(New_Style); In this syntax, the New_Style argument is optional. Thus, for my example, the correct code would ...


2

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 // Keith Gilbert // www.gilbertconsulting.com // blog.gilbertconsulting.com // // http://www.gilbertconsulting.com/resources-scripts.html // check for a doc if (app....


2

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 into your design. I've pulled together an example in Codepen that should help. Here is the essential CSS: -webkit-clip-path: ellipse(60% 80% at 50% 0%); clip-...


2

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, actors are randomly placed on the canvas and then walked in the direction determined by the Perlin noise function. If each of these "walking" paths could be saved ...


2

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. The XML is basically a set of declared path objects: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www....


2

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 creating a new document and writing the text on that. You should use var doc = app.activeDocument; instead of var doc = app.documents.add(null,width,height); ...


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