Questions tagged [javascript]

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

37 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
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
1 vote
0 answers
97 views

Illustrator scripting: setting bleeds

Trying to solve this has been an odyssey, thanks in part to Adobe's new community platform breaking old links. Most of what I found is in this thread. So for some stupid and arbitrary reason, document ...
user avatar
  • 11
1 vote
0 answers
48 views

Script to create linear path from bezier path on document grid

How do I find the nearest grid point of a bezier path as it intersects the document grid? I am writing a script to create a linear copy of of a bezier path. I need to know where the path crosses the ...
user avatar
  • 111
1 vote
1 answer
195 views

Get the average color of a raster image for a mosaic effect

I've been searching for a way to get the average color of a raster image, to use in a vector grid in front of it to create a mosaic effect - the "Object > Create Object Mosaic..." menu ...
user avatar
1 vote
0 answers
59 views

Selecting and moving anchor points based on User input

I am pretty now to scripting inside Adobe Illustrator. I made a basic script, that opens UI window, where user input three dimensions and the output is three variables X, Y, Z. What I want: I want ...
user avatar
  • 11
1 vote
1 answer
398 views

How to automatically generate text that adopts the same name as an imported image or Excel file in illustrator?

I have a lot of product photos to edit in Illustrator. I want to create several artboards with one product image, and then one text box for each artboard, but I need these to automatically adopt the ...
user avatar
  • 11
1 vote
0 answers
250 views

Confusion about stroke and fill for SVG path animations?

I'm trying to replicate this SVG animation: Codepen-original but with my SVG logo. Here is the same codepen with my SVG logo: Codepen-with-my-SVG. I'm new to dealing SVG's and started learning and ...
user avatar
1 vote
0 answers
365 views

Resizing all objects in a layer using Illustrator CS5

IN SUMMARY...MANUALLY all I need to do is ...select all...change width or height depending on which side is longer and constrain THAT'S IT >.<....SOUNDS SIMPLE RIGHT? THE QUESTION IS THIS....Am I ...
user avatar
  • 11
0 votes
0 answers
24 views

Is there a way to script this button in Datylon?

The button is to relink the data in the file. I have been in contact with Datylon, but I think they are trying to upsale me to use their server integration, but for security reasons, this is not ...
user avatar
0 votes
0 answers
56 views

Replace Smart Object Script doesn't place the image in the right size, what to do?

// Replace SmartObject’s Content and Save as JPG // 2017, use it at your own risk // Via @Circle B: https://graphicdesign.stackexchange.com/questions/92796/replacing-a-smart-object-in-bulk-with-...
user avatar
  • 3
0 votes
0 answers
21 views

Drag object around a circle on mouse over - Adobe Animate/Create.js/Easel.js

Using Adobe Animate HTML5 Canvas which employs Create.js/Easel.js. I have the following code which drags an object around a circle. Works Ok, but the object should only be moveable when the cursor is ...
user avatar
0 votes
0 answers
78 views

How to modify and fix this Adobe CEP Extension (Adobe Scripts Panel)

There is a very useful Adobe CC extension called Adobe Scripts Panel, which is essentially a panel that lets you run scripts on the fly without having to go to File > Scripts > Select Script in ...
user avatar
  • 113
0 votes
0 answers
50 views

Adobe Animate - HTML5 Canvas - Logic Problem?

I have MC symbols which can be set to the stage though ComboBoxes and dragged into a position. I need to check if any have been dragged into the position in order to run some functions, one being: ...
user avatar
0 votes
0 answers
39 views

Anyone know of a Photoshop Script to change the Hue of multiple layers, randomly and within defined limits?

I have multiple layers, all the same color, and I'd like to use a script to randomly shift the hue a small amount, say anywhere between (-6,+6) to each of the selected layers. I want to produce slight ...
user avatar
0 votes
0 answers
40 views

Photoshop scripting: save JPEG with different canvas size than document

I'm writing a Photoshop script (in javascript) to save a copy of the document as a JPEG and I would like to save it with a smaller canvas than the photoshop document, without changing the document I'm ...
user avatar
0 votes
0 answers
79 views

Illustrator - how to properly check the path is a rectangle shape and is rotated using javascript?

When I import DWG files which contain simple objects, mostly rectangles, circles, lines or polygones and save the result in SVG sometimes i get shapes with matrix transformation. I know what is matrix ...
user avatar
0 votes
0 answers
21 views

Adobe PDF JavaScript 'app.execMenuItem("ZoomViewOut")' not working as document level script

I put the line app.execMenuItem("ZoomViewOut"); into my PDF document's JavaScript section like this: It turns up in the general JavaScript section like this: //-----------------------------...
user avatar
  • 153
0 votes
0 answers
88 views

Show/hide standard Adobe Reader toolbar using JavaScript

Is there a line of JavaScript that can be used to show/hide (ideally alternately as a toggle) the default toolbar in Adobe Reader -- i.e. the same that happens when you press F8? I have tried  app....
user avatar
  • 153
0 votes
0 answers
78 views

Photoshop Javascript - color lookup set lut

Say I have the lookup layer as lookup = app.currentDocument.activeLayer How can I set the setting on the layer? As far as I can tell its Art Layer base class, and I can only see base calls in my data ...
user avatar
  • 101
0 votes
0 answers
58 views

AI Script to control the anchor of the rectangle from the left

Can I control a rectangle's anchor on the left with a script up or down (like in the picture). var Rctngl=0; var var_Integer; mm = 2.834645731787465 var_Integer =Rctngl; var_Integer = prompt ("...
user avatar
  • 11
0 votes
0 answers
58 views

How to add an image from local machine to already existing layer on photoshop using javascript photoshop scripting?

I have an existing design and layers on photoshop and I want to add an image from my local machine to one of those layers and I don't know how to do it using a script on javascript? please any help on ...
user avatar
0 votes
1 answer
127 views

How to place xml nodes into indesign pages (one by one)?

I am trying to place a lot of tables into my document, one by one, but i can't place more than 1 table, does anybody knows how to place each table on one page or textframe? I am using xml nodes like ...
user avatar
0 votes
0 answers
49 views

Making svgs in Illustrator that can be morphed from one to the next using javascript

I want to make an animation like this one using svgs and javascript: https://codepen.io/noeldelgado/pen/JdbmYW The problem is that in order to make this transformation possible all the svgs between ...
user avatar
  • 3
0 votes
1 answer
312 views

Photoshop Scripting - applying changes only to selected artboards

Having trouble specifically with artboards for Photoshop scripting. What I want it to do: I have a photoshop file with 8 artboards, and I want to apply changes (name changes) to the selected ...
user avatar
0 votes
0 answers
318 views

How to replace Smart Image with a different graphic WITHOUT using Photoshop?

This Q&A offers a method by using Photoshop to load .js. However, I found this website can achieve this goal without using Photoshop. My question is how this website achieves this goal?
user avatar
  • 101
0 votes
0 answers
122 views

Update Adobe Illustrator CS3 plugin to CS6

I'm seeking a method to make a script currently compatible with Adobe Illustrator CS3; compatible with Ai CS6. On launch Ai CS6, displays "Error loading plugins". The issue could be the UI, as CS3 and ...
user avatar
  • 1
0 votes
0 answers
53 views

How to find all text layers with specific color and replace this color with an other one?

Recently, I added a similar question about how to find all shapes with specific color and replace this color with an other one. Sergey Kritskiy gave me the solution with a working example which I ...
user avatar
0 votes
0 answers
71 views

How to enumerate images on A4 print for multiple pages on Phtoshop?

I have to print some labels on an A4 paper. These labels need to be enumerated with iteration for multiple prints. About 8 labels per page, and more than 10-15 pages, depending on the requirement. I ...
user avatar
  • 183
0 votes
1 answer
488 views

ScriptUI panel resizing issue

I'm working on a script that receives a bunch of input from the user to change certain text fields around the document. Given the amount of input I want the user able to change in a single run of the ...
user avatar
0 votes
0 answers
338 views

Illustrator Script Group Sublayers One By One

Trying to convert all sublayers of my design (with or without children) into a group on its own. You can check on my screens what i have to what i need to obtain. What i have What i need Here is ...
user avatar
0 votes
2 answers
269 views

Test if two Adobe Illustrator PathPoints are the same in script

I am trying to write a function that takes a PathPoint and returns its index relative to it's parent PathItem. Something like this: function getPathPointIndex(pathPoint) { var pathPoints = ...
user avatar
  • 101
-1 votes
2 answers
1k views

Creating interactive images/videos with links for website?

I am curious on how websites create interactive videos and images with links for websites? Is this accomplished with flash and if so any recommendations on software to use to create basic pages like ...
user avatar
-2 votes
1 answer
1k views

Replacing a smart object in bulk with Photoshop script; Editing script for more than one smart object

I found the following code and it works very well for most Photoshop files I have tried, but the file I want to use it with has 2 Smart Objects, one nested in the other. See attached images. Is it ...
user avatar