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
2answers
212 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 = ...
1
vote
2answers
66 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 ...
-2
votes
0answers
23 views

Does anyone know how to create this type of loop animated website [closed]

Does anyone know how to create this type of loop animated website? Is there any tool to make this? https://eatgenesis.com/ Any help will be appreciated. Thanks, Stay Safe
0
votes
1answer
1k 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 ...
-1
votes
0answers
29 views

Why can't I resize my image bigger than my canvas in photoshop using javascript?

my code // get a reference to the current (active) document and store it in a variable named "doc" var doc = app.activeDocument; var layer = doc.activeLayer; layer.translate(new UnitValue(...
6
votes
2answers
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 ...
0
votes
1answer
72 views

inDesign Script to “when textbox created paste clipboard content in it”

I have no experience with scripting, but I can maybe explain what the intented script should do: Select text, cut it. Ctrl + X after mouseUp. Make textbox (manually). Drag with mouse, if possible &...
0
votes
1answer
99 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
1k 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
2answers
645 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
1answer
82 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
1answer
197 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
1answer
174 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 ...
1
vote
1answer
578 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
65 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
226 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
384 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 ...
3
votes
1answer
181 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.
0
votes
1answer
44 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
0answers
33 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 ("...
0
votes
1answer
46 views

ExtendScript: Align group items centered in Ilustrator

Hi, I am new to illustrator and I want to align the textFrame centered to the pathItem(square) using Extendscript as shown in picture1. I have uploaded another picture, which shows the layer and group ...
0
votes
0answers
27 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
38 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
54 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
0answers
114 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
45 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
2answers
658 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 ...
-2
votes
1answer
193 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
361 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
0answers
39 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 ...
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
256 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
68 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
29 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
705 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
234 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
1k 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
80 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
97 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
87 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
145 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
68 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
82 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
37 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 } ...
0
votes
1answer
344 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
370 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
200 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
171 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 ...