Questions tagged [javascript]

Questions related to Javascript code, one of the main technologies behind the web and also being used in Adobe software.

Filter by
Sorted by
Tagged with
8 votes
1 answer
1k views

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

How would you write a script to move all points of all selected paths to the nearest (non-pixel grid) grid point? e.g. I want all of the points of each polygon/path to snap to the nearest point on a ...
user avatar
7 votes
1 answer
2k views

Problems with Dynamic Text in SVG when font is not SVG

So, I have an graphics automation chain that has been happily running on a headless linux environment using programmaticaly generated/altered SVGs and PhantomJS (currently 1.9.0) as a final rendering ...
user avatar
  • 71
6 votes
2 answers
3k views

Long Shadow Effect in SVG for Web

Basically I'm wondering if anyone has any ideas on how to efficiently get a long shadow effect with an SVG: Example Image My three ideas on how this might be possible: Hella detailed gradient map, ...
user avatar
6 votes
2 answers
2k views

Ending a Photoshop script when no layers are selected

I've been working with a function I found on stackoverflow here that works as far as I can tell by grouping the layers, dumping layer names into an array then ungrouping them. function ...
user avatar
5 votes
1 answer
2k views

InDesign: how to remove everything between square brackets

I have a script to find all textframes in a document, and do a regular expression to remove (if contains) all text inside square brackets. For example the text frame might contain: "Lorem ipsum ...
user avatar
  • 197
5 votes
2 answers
471 views

Talking about front end web development frameworks from a designer's perspective

I am a web developer working at a company where the front end framework we have selected is Angular JS. I am now in the position where I am the 'resident expert' whatever that means. I have been ...
user avatar
  • 153
5 votes
1 answer
1k views

Indesign - remove empty cells from table

I have imported XML which contains nested tables and have created a script to remove all empty cells which is as: var myDocument = app.activeDocument; for(var i=myDocument.textFrames.length-1; i>=...
user avatar
  • 197
4 votes
1 answer
2k views

Vector Format Perlin Noise Effect

Goal is to Achieve vector formatted Perlin noise line art. Visual Examples of the desired effect: It is possible to create a static Perlin noise effecting using only Adobe Illustrator or photoshop? ...
user avatar
  • 53
4 votes
1 answer
2k views

Acrobat - placeholder text for form field?

I have created a form in Acrobat and would like to have placeholder text within each field instead of actual labels for each field. The first approach was a script I inserted into "custom" under the ...
user avatar
  • 997
3 votes
1 answer
553 views

How to select or copy all text in InDesign document

I want to select all text content of every page in an InDesign document or copying all text in InDesign document. I have tried scripting method, but did not work.
user avatar
  • 31
3 votes
1 answer
302 views

How do I fix missing opacity masks in rendered svg files on the HTML5 Canvas [closed]

I'm currently working on a project that is using the HTML5 Canvas API and I'm encountering a few problems, one of which is disappearing opacity masks used to add texture to an element in Adobe ...
user avatar
3 votes
1 answer
461 views

Bullet list syntax for Adobe InDesign script

I'm looking for the syntax that defines bullet points so that I can create a bullet list in a script for use as a guide template for other users. At a guess my best bet so far is that it's under '...
user avatar
  • 33
3 votes
1 answer
1k views

Animated SVG Javascript Infographic for timeline

I am considering to make an animated infographic based on SVG, Javascript and CSS technologies of a timeline. I have lots of experience in programming but not so much in using these technologies to ...
user avatar
2 votes
1 answer
2k views

InDesign script to list hyperlinks in active document

I am trying to get a list of hyperlinks from my document printed in the console or output to text file. This is what i'm playing with: for (k=0; k<app.activeDocument.hyperlinks.length-1; k++) { ...
user avatar
  • 27.6k
2 votes
1 answer
10k views

Exporting SVG paths to HTML to animate with JavaScript

I have a complex blueprint, which I've traced in Inkscape. I'm going to programmatically animate the path and also add some other effects with JavaScript. I can include the file using HTML (e.g. <...
user avatar
  • 462
2 votes
1 answer
325 views

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

I am a meteorologist. I use Photoshop to help annotate maps. One thing I always wanted to do, but couldn't, was draw weather fronts. Recently I've come across some javascript used by leafletjs to ...
user avatar
  • 121
2 votes
2 answers
1k views

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

I have used javascript to script before, using an eventlistener to say app.addEventListener( "beforeClose" , [function]); function [functionname]() etc... What I need is a way to tell InDesign '...
user avatar
2 votes
1 answer
2k views

What is the difference between .jsx and .js?

I am new to Adobe Scripting - what is the difference between .jsx and .js?
user avatar
  • 231
2 votes
2 answers
2k views

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

I can delete a layer by name: var myDoc = app.activeDocument; var myLayers = myDoc.layers; var myLayer = myLayers["layer name"]; myLayer.remove(); or by stacking order: var ...
user avatar
  • 35
2 votes
1 answer
643 views

Logarithmic Spacing in Illustrator

I'm trying to space text logarithmically. My goal is essentially the same as the one presented here, which is useful but doesn't help me as the only advice provided is to use JS, which I'm not ...
user avatar
2 votes
1 answer
976 views

Website Designs with Round Headers?

Does anyone have any examples of live websites with round headers? Similar to this: http://www.nasty-creatures.com/ I'm working on something for a client and have come up with a design with a round ...
user avatar
2 votes
2 answers
1k views

How to approach animating a svg from left to right? [Web]

I have image below which is text mixed with dots. As the paths are not in order from left until right, how would one approach animating from left to right? The only way I can think is to label each ...
user avatar
2 votes
2 answers
4k views

Indesign script to replace paragraph style

I am using ID CC 2014 on a Mac and there's a huge file with several hundred pages where I need to delete a certain paragraph style replacing it with another. Say there's a para style called "style-1". ...
user avatar
2 votes
1 answer
4k views

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

Consider the following text: She sells sea shells. Say my insertion point is currently at a blank space between two words, i.e. app.selection[0].characters.length < 1 I need to select or return ...
user avatar
2 votes
1 answer
329 views

Is it possible to animate a PNG image with canvas?

I saw this page and wanted to know if anyone can point us in the direction of how this was created? this moving effect in the header. https://www.jetbrains.com/ i tried something like but i dont ...
user avatar
  • 21
2 votes
1 answer
405 views

Scripting Artboard Export with specific bit depths

I'm working on setting up a reusable template for some PNG avatars. Unfortunately, the different avatars have specific export requirements. Currently I'm using Save for Web to achieve these specific ...
user avatar
2 votes
1 answer
2k views

After Effects expressions to sum numbers and control charts

I would like to build a project in which I will change two numbers and all of the following take place automatically! I'll Explain... Part 1: I have two layers, "Number 1" and "Number 2". Suppose I ...
user avatar
2 votes
0 answers
137 views

How can I get layers data in relation to their group name?

I am making a Photoshop script which gets every layer with Bevel and Emboss effect and then doing some actions. I have make this function so to get layers data... function getLayersData() { ...
user avatar
2 votes
0 answers
359 views

Artboard renaming issue

I'm working on a script for my team that will allow them to batch rename artboards in Photoshop. We use the following naming convention for our artboards: "ProjectTitle_BannerType_WidthxHeight_LG" ...
user avatar
2 votes
0 answers
1k views

Script to resize InDesign page to fit content

I'm wanting to use ExtendScript javascript to loop through each page of an Adobe InDesign document and change the size of the page to match the visible bounds of all the objects on that page. I'll ...
user avatar
2 votes
0 answers
326 views

Photoshop Javascript - Resize not working correctly

I have written a script in Javascript for photoshop which gets user input (number of boxes on the desktop) then converts it into pixel sizes. The problem is on resizing, the layer doesn't change to ...
user avatar
  • 21
2 votes
1 answer
410 views

exportSVG in jsfl run as a command in adobe animate doesn't work

In Adobe Animate and with a .fla file (after importing a swf file, import to stage), I run this script var exportFileName = 'file:///C|/temp/files/a.svg'; fl.getDocumentDOM().exportSVG(exportFileName,...
user avatar
  • 133
1 vote
2 answers
981 views

InDesign Script to create URLs

Is there a script to use within InDesign so it finds a URL within textframes and it turns it into a hyperlink? As I am aware, to create a hyperlink within InDesign requires you to right click and ...
user avatar
  • 197
1 vote
5 answers
2k views

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

I have an SVG with a few curved paths. I'd like to create n versions of this, by rotating them around as a group (360 / n degrees apart), around the center of the square-shaped canvas they're in, like ...
user avatar
1 vote
1 answer
95 views

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

Any libraries, API, or tips are welcome. I am trying to draw Landsat 8 images using Canvas utility of Javascript on my browser. The grayscale reflectance values for Landsat 8 bands are from minimum -...
user avatar
1 vote
1 answer
60 views

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

I've been using cusotmised Materialize CSS for most of the effects I want on my pages. I know very little JavaScript. Is it reasonable for me to continue working with frameworks such as Materialize ...
user avatar
1 vote
1 answer
53 views

3d virtual exhibition stand

I would like to make an online 3d virtual exhibition stand (visitors of the website should be able to "go" through the 3D stand-model and by chance click on the items or watch the videos on ...
user avatar
  • 11
1 vote
1 answer
304 views

Extendscript: How can i change text frame attributes in illustrator

Hi, I am new to illustrator and do not know about its tools' name. So, I want to change these attributes(underlined in red color shown in the picture) through ExtendScripting. Just let me know their ...
user avatar
1 vote
1 answer
83 views

How can I get an alert with layers count before they change?

I have this function below and before it calls bevel(); function, I want first to add an alert where it says how many layers going to be change... function goThroughLayers(parentLayer){ for(var i=...
user avatar
1 vote
1 answer
897 views

InDesign script to insert pages between existing ones

I try to create a very simple script that adds one page after every existing page of the document and applies one of the masters to it. Unfortunately I have a problem with referencing objects in ...
user avatar
1 vote
1 answer
643 views

How to select all shapes with specific color and replace this color with an other one?

I am totally new in Photoshop scripting, but I have some JavaScript experience. I want to make a script (or find an existing one and study it) that finds every shape with a specific fill color in my ...
user avatar
1 vote
1 answer
1k views

Photoshop javascript, how to select contents of a layer

Is there a method for the following function (mac) Command-click on thumbnail in layer panel? (So all non empty pixels get selected in specified layer.)
user avatar
  • 29
1 vote
1 answer
1k views

What is a Type 1 font in InDesign?

Diving down the rabbit hole of scripting InDesign to learn more about what fonts are in a file I ran across several font types but I'm unsure what it means in InDesign when you have a Type 1 font type....
user avatar
1 vote
2 answers
645 views

How to write a photoshop script to resize the image until it covers the whole canvas? (not just fit the height[or shortest length])

How to Batch Resize in Photoshop This doesn't seem to work, so I think a script way might be what I need. Adobe Photoshop Scripting The resize method in its JavaScript reference guide doesn't seem to ...
user avatar
1 vote
1 answer
135 views

Why does InDesign search not begin at beginning?

I am using a script to copy sequential lines from an input text file into an InDesign document. I have used the script a number of times with no problems. var fi = new File("C:/Documents/input.txt") ...
user avatar
  • 155
1 vote
1 answer
97 views

Get values from an applied bevel and emboss effect for multiple layers?

I created this function below, to get some values from an applied bevel and emboss effect, like shading angle, shading altitude etc. alert("Angle: " + getBevelAndEmbossValues()[0] + "\nAltitude: " + ...
user avatar
1 vote
1 answer
577 views

Script: Change color Saturation while maintaining L in LAB model

For example, I have a red color #633b3d (Saturation: 40, L: 30) and I want to transform Saturation to 80 while maintaining L (resulting color should be #83211b). If I simply change foregroundColor.hsb....
user avatar
1 vote
1 answer
956 views

Scripting - Artboards names in photoshop

I checked in the Photoshop's Documentation if there was any option to work with artboards in scripting. Unfortunately I couldn't find anything. Does anyone have experience in working with artboards ...
user avatar
  • 100
1 vote
1 answer
168 views

Adobe Illustrator Script Adjustment

I'm working a script to make ALL the texts of a document with some specifics. Glad to say it's already functioning but not completely because it's just working on some of the textframes and not all of ...
user avatar
1 vote
1 answer
751 views

Is there automatical way to fill white pixels to black if it's surrounded by black pixel? See my image for more details

Basically, if you look at the image I want to fill the white noise if it's surrounded by black pixels. Maybe not a single white pixel but I definitely would like to fill the bigger patches. I was ...
user avatar