photoshop

Use javascript in Photoshop to modify the contents of a text item

。_饼干妹妹 提交于 2021-02-17 05:10:19
问题 I know how to set the contents of a textitem in Photoshop using code like this var al = doc.activeLayer; if(al.kind == LayerKind.TEXT) { //get the textItem var ti = al.textItem; //change contents ti.contents = "stackoverflow"; } However is it possible to modify just part of its contents and apply formatting. For example in the work "stackOverflow" I just want to select the first letter and make the font 30px and leave the rest unchanged? 回答1: There's no easy way to do that to my knowledge.

Photoshop Script - Change specific text layer contents

允我心安 提交于 2021-02-11 13:32:18
问题 I have a photoshop script file which opens up a template psd file: var fileRef = new File("z:\psd.psd") var docRef = app.open (fileRef) Once this is open, i would like code which changes the text of a specific layer called "LAYER1" to "TEST". I have researched and carried out numerous tests but i am having issues and errors with undefined variables. 回答1: It it will be necessary to loop over all layers, (including layers within Layer Groups ), to find your specific named Text Layer (e.g.

Photoshop: How to handle numbering a large amount of disorganized items?

↘锁芯ラ 提交于 2021-02-08 11:40:39
问题 Suppose I have a large campsite like "seating" chart with several hundred lots sectioned off and outlined in photoshop. (each lot is roughly a square) Every lot needs to be numbered in photoshop and also editable in the future in case of changes. The lots are scattered and curve around the landscape so entering text in one layer seems out since for example lot 27 with be on the right and rotate 20 degrees to match the lot and yet lot 185 might be way over on the left at a far different angle.

Duplicate layers in multiple artboards - Photoshop 2019

时光总嘲笑我的痴心妄想 提交于 2021-02-08 10:13:04
问题 Is there any way or script to copy layer to all artboards in Photoshop? Thank you in advance, because I could not find a solution 回答1: Artboards are just specialized layer groups, which can be targeted with the document.layerSets property. In this working example (tested and working in Adobe PS CC 2019), I make the assumption that there is 1 layer we are copying and each artboard has 1 layer already in it. For a visual demo, check out this screencast gif: https://www.rebel-ist.com/img/example

Running a Photoshop “Action” from a Javascript Script

…衆ロ難τιáo~ 提交于 2021-02-07 10:15:27
问题 I´m writing a Photoshop script to open some images and do some things on them. So far so good. I need the script to play a given Action previously recorded on Photoshop. How can I invoke and play a Photoshop Action from a Javascript code? I´m looking for something like: app.actions["actionName"].play() app.actions["actionName"].onComplete(function(){/*do stuff when finished*/}) (Translating the action into JS code is not an option for my application) 回答1: The code i believe you are looking

Running a Photoshop “Action” from a Javascript Script

好久不见. 提交于 2021-02-07 10:14:56
问题 I´m writing a Photoshop script to open some images and do some things on them. So far so good. I need the script to play a given Action previously recorded on Photoshop. How can I invoke and play a Photoshop Action from a Javascript code? I´m looking for something like: app.actions["actionName"].play() app.actions["actionName"].onComplete(function(){/*do stuff when finished*/}) (Translating the action into JS code is not an option for my application) 回答1: The code i believe you are looking

Photoshop move layer along y-axis

非 Y 不嫁゛ 提交于 2021-02-04 21:45:22
问题 I'm working on a script that will move a layer, right, left, up, or down. This depends upon which edge of the layer is inside the canvas. I've managed to get the layer moving left and right (x-axis) using bounds[0] and bounds[2]. But when I try to get it to move up or down, it still moves left/right. Is it the bounds number I've got wrong? var Y1 = bounds[3].as('px'); var Height = app.activeDocument.height.as('px'); //move down if (Y1 < Height) { activeDocument.activeLayer.translate(Height-Y1

Pixels in photoshop vs pixels in CSS?

我的梦境 提交于 2021-01-29 10:46:06
问题 I notice that when I measure out something in Photoshop to "ensure pixel perfection" it's usually half of what's measured in Photoshop to go to CSS. So if I measure at 60px, in CSS it goes to 30px. But only roughly so.. Is there a way to make sure it matches 100% so I don't have to guesstimate? And why does this happen? 回答1: When you are measuring out those pixels in Photoshop, you have to make sure you know what size your resolution is. For the web, it uses 72 dpi resolution, check in

Get selected layers

点点圈 提交于 2021-01-29 06:02:40
问题 Unlike this question, is there a way to return an array of currently selected layers, without having to loop over all the layers and therefore removing/readjusting that selection? function get_selected_layers() { var layers = app.activeDocument.activeLayer; // only works with *last* selected layer // not *all* selected layers } var thelayers = get_selected_layers; alert(thelayers); 回答1: Sort of but not really. There's no native way of getting an array of selected artLayer objects. But there's

How check if photoshop brush exist programmatically

╄→гoц情女王★ 提交于 2021-01-29 05:11:21
问题 I'm trying to create a Photoshop Panel for some actions, but I want to know how can I check if the brush already exist in photoshop and if not exist to call a function to install it before the action can be used, I already know how install it, and how run the actions, but I still got some issues detecting if the brush exist on Mac/Windows environment. Any tips about how do this using Javascript? (JSX) 回答1: You can get lists of brush or tool presets using this AM snippet. Note that several