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 ...
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....
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 ...
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();
...
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 ...
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 ...
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 ...
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:
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
...
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();
...
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 ...
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 ...
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....
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 = ...
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 ...
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
}...
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.
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 ...
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 ...
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, ...
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 ...
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.
...
2
votes
Script to change a color in all layers of a PSD file to another color?
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 colourY = "ff00ff";
changeFontColour(colourA, colourY);
...
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 = ...
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 ...
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 ...
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 ...
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 ...
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 = ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
javascript × 157photoshop-scripting × 45
adobe-photoshop × 43
adobe-illustrator × 35
adobe-indesign × 31
illustrator-scripting × 29
indesign-scripting × 27
script × 20
svg × 13
cc-2019 × 11
website-design × 9
css × 8
export × 6
animation × 6
resize × 5
batch-processing × 5
html × 5
automation × 4
vector × 3
pdf × 3
artboard × 3
adobe-acrobat × 3
grep × 3
canvas × 3
chart-design × 3