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
0
votes
1answer
70 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") ...
0
votes
0answers
20 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 ...
0
votes
0answers
21 views

how to combine some jpg & png layers into a psd file, without using photoshop

i know a python script can make psd file layers resolve into many pieces. but i want to manage my button & banner modules(huge mounts of). is there any way i can merge layers into one psd without ...
0
votes
0answers
23 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 ...
0
votes
1answer
119 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 ...
0
votes
0answers
21 views

Exporting InDesign file to XHTML file with script

I have a inDesign file with many pages that I want to export to XHTML format. I use a script i found to do so: Main(); function Main() { // Check to see whether any InDesign documents are open. ...
0
votes
1answer
34 views

Indesign: Javascript to access the New Hyperlink panel

I want to create what is hopefully a simple javascript action that I can assign to a keyboard shortcut to save me clicking the same steps over and over. Basically, I want to highlight my text, then ...
0
votes
0answers
19 views

Create multiple document from each group in illustrator useing javascript

I have Ai file whitch file have many groups each group different design. How can I create javascript to separate each group to file. Or any options to do this and each file have to be same name as ...
0
votes
1answer
72 views

How to change the color of text inside a TextFrame instead of color of the bounding box itself

Inside indesign javascript scripting: how it is possible to change the color of a block of text instead the color of the bounding box of the block itself? Because something like: textFrame.fillColor ...
0
votes
1answer
53 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 ...
1
vote
1answer
149 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 ...
0
votes
1answer
321 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 ...
0
votes
2answers
625 views

“Fit All in Window” using JavaScript

I've recently started scripting in Illustrator and having a little problem. When creating a document through File tab, (File->New, Print, Letter) the created document is positioned at (0,0) and the ...
0
votes
1answer
854 views

Illustrator Script Help create LAYER TO GROUP function

Im kind of new on this and im trying to find a solution to "Group" all layers in INDIVIDUAL/SEPARATE GROUPS. Have not been successful within the 1st stage of my script to work by grouping each layer ...
6
votes
2answers
1k 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 ...
-2
votes
1answer
55 views

how get paragraph style and character style of selected text in indesign by script

I want the selected text to be displayed to me when I select a word or text in InDesign by executing the style paragraph script and its style character?
0
votes
1answer
50 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 ...
2
votes
1answer
915 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 ...
0
votes
1answer
189 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 = ...
0
votes
1answer
113 views

Move item to a different layer using script in Adobe Illustrator

This may be a something I skipped over in my search, but can anyone show me how to add an item to a layer using a JavaScript Adobe Illustrator script? Also, are there any good resources for learning ...
0
votes
2answers
579 views

ScriptUI Photoshop Palettes

I'm working on a photoshop script that contains a GUI for collecting information. This is my first time using Script UI and I'm running into 2 issues that I'm not sure how to address. Issue 1, the ...
0
votes
0answers
26 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 ...
0
votes
0answers
32 views

SVG borders get blurry on drag

While dragging an SVG rect the top border changes its width depending on where the rect is dragged and positioned on the screen. For example, sometimes it looks wide and blurry: And sometimes it ...
5
votes
1answer
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 ...
0
votes
1answer
174 views

Issue on returning a variable from an evalScript function

I am working on a CEP HTML panel for Photoshop and I want to check first if there is any opened documents before my panel do what it has to do. So I made something like this into my index.js so to ...
0
votes
1answer
45 views

Communication issue between functions into JS and JSX files

I have made this function into a JS file... function getColors(isPick, isForecolor) { var chosenFunction = 'getColor(' + isPick + ', ' + isForecolor + ')'; csInterface.evalScript(...
1
vote
0answers
22 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 ...
0
votes
2answers
533 views

Dieline image to a box in Three.js

I have created a dieline image using Three.js. Now I need to convert this dieline into a box. This is my code for the dieline: <script> var canvas; var imgElement = document....
0
votes
0answers
191 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?
0
votes
2answers
739 views

How can I export a PDF from InDesign with Javascript?

I want to find a script (preferably Javascript) and all it needs to do is export a PDF to a specific folder that I can set the path for in the script. Does anyone know of a script that might have ...
2
votes
0answers
72 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() { ...
2
votes
1answer
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 ...
0
votes
0answers
87 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 ...
1
vote
1answer
85 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: " + ...
0
votes
0answers
50 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 ...
-1
votes
1answer
128 views

Explanation of a function line by line for learning purposes!

As the title says, I need someone to give me an explanation of this function below, line by line, for learning purposes. Thank you in advance!!! function getAllShapeLayersData() { var lyrs = []; ...
1
vote
1answer
54 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=...
0
votes
1answer
80 views

What is the right way to count all the layers that are going to change into a script?

I am using a script (by Sergey Kritskiy from this question) so to select all shapes with specific color and replace this color with another one. I made some changes, I have also add a confirm window (...
0
votes
2answers
33 views

How can I get all shape layers where their names include specific word?

I have this function which gets all shape layers of a document... function getAllShapeLayersData() { var lyrs = []; try { activeDocument.backgroundLayer; var layers = 0 } ...
1
vote
1answer
356 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 ...
0
votes
1answer
248 views

How can I get an RGB color using Photoshop's color picker instead of systems's?

I am using this script bellow to get an RGB color from color picker. Any idea how can I do the same thing but using Photoshop's color piker instead of system's one? var hexToRGB = function(hex) { ...
1
vote
1answer
207 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 ...
2
votes
1answer
112 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 ...
1
vote
0answers
155 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 ...
1
vote
1answer
276 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....
0
votes
1answer
333 views

InDesign: building charts in EPS or Javascript

Working with alot of business documents and would like to be able to build something like the below chart using post script code. I know something like this can be hardcoded as a plain text EPS file ...
1
vote
1answer
404 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 ...
0
votes
1answer
79 views

How to run photoshop closed?

Is it possible to run photoshop without running it? I want to run an action that basically replaces image layers and text layers, and quick exports results. Summing up, I have come to know about ...
0
votes
1answer
148 views

Layer doesn't resize properly

I'm having problems figuring out why my layer does not resize to match the dimensions of the source layer. I set signatureLayer equal to the layer named "signature" and pass it and the layer I want ...
0
votes
1answer
370 views

How to change in photoshop script color of Smart Object Layer, or Rasterized Image?

I need to change color of Smart Object Layer in JS script. I found how to change TextLayer, but SmartObjects haven't "textItem" property. Need to change it like Color Overlay works in Photoshop. For ...