photoshop-script

How to write text to a text file by Photoshop JavaScript?

旧巷老猫 提交于 2019-12-03 16:58:44
问题 I took a look at Photoshop CS5 Scripting Guide and Photoshop CS5 JavaScript Reference, but I couldn't find out a method to write text to a plain text file. Is there any way to do that? I want to record the value of bounds of each layer object in a document. Any hint? 回答1: File system access is documented in Adobe's JavaScript Tools Guide (PDF). Download the PDF file and check out the "File System Access" section. 回答2: This works for me, saves text with the same name as original document, but

How to load an image in active document? (Photoshop Scripting)

佐手、 提交于 2019-12-03 13:50:57
I am new to photoshop scripting. I want to load an image image (from my hard disk) into the active document as a new layer with positioning. How can this be done? Can somebody please share the code? Thanks Myra You can open Photoshop File Dialog for searching your image and adding that into a layer file = app.openDialog();//opens dialog,choose one image if(file[0]){ //if you have chosen an image app.load(file[0]); //load it into documents backFile= app.activeDocument; //prepare your image layer as active document backFile.resizeImage(width,height); //resize image into given size i.e 640x480

Saving per-user or per-document preferences in a Photoshop script

雨燕双飞 提交于 2019-12-03 12:53:04
问题 I'm working on a Photoshop script in JavaScript using ExtendScript. My script allows some user input, and I'd like to save it between uses. That is, I'm looking for a way to save a simple string or numeric value under a particular key so that I'll be able to access it on subsequent uses of the script. Simply put, I want to save a preference for my script. How do I do that? Even better would be to be able to save at least some preferences on a per-document basis. Is that possible? That is, can

How to write text to a text file by Photoshop JavaScript?

拟墨画扇 提交于 2019-12-03 06:02:16
I took a look at Photoshop CS5 Scripting Guide and Photoshop CS5 JavaScript Reference , but I couldn't find out a method to write text to a plain text file. Is there any way to do that? I want to record the value of bounds of each layer object in a document. Any hint? nobody File system access is documented in Adobe's JavaScript Tools Guide (PDF) . Download the PDF file and check out the "File System Access" section. This works for me, saves text with the same name as original document, but with extension txt : function saveTxt(txt) { var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '')

From Photoshop actions to Photoshop scripting?

妖精的绣舞 提交于 2019-12-03 01:43:50
问题 I would like Photoshop to automatically execute the following task for a given folder: Load all PNG files in a given folder. Convert each file's mode to RGB color Add one layer to each file Save the files as PSD in the same folder I have been told that this can be done with Photoshop scripting, but I don't know how to get started since unfortunately I don't have much experience with JavaScript. One thing I know is that I can't run the task above using Actions because when I record the last

From Photoshop actions to Photoshop scripting?

橙三吉。 提交于 2019-12-02 15:18:11
I would like Photoshop to automatically execute the following task for a given folder: Load all PNG files in a given folder. Convert each file's mode to RGB color Add one layer to each file Save the files as PSD in the same folder I have been told that this can be done with Photoshop scripting, but I don't know how to get started since unfortunately I don't have much experience with JavaScript. One thing I know is that I can't run the task above using Actions because when I record the last step (4), Photoshop records the action to save the PSD files in the folder that I use when recording the

Photoshop CS5 not recognising activeDocument

假装没事ソ 提交于 2019-12-02 05:57:12
问题 I wrote a quite big script for Photoshop CS5.1 on my 64bit Vista machine. Now when I run the very same script on my new 64bit Windows 7 machine, Adobe ExtendScript Tool complains about activeDocument (no such element) in this simple script: #target photoshop var pDoc = app.activeDocument; alert("Done!"); I have tried both and without #target and choosing the target in the ExtendedScript Tool. Is there something I have missed, or do I need to install something more. I only installed the 64bit

Launch photoshop action using code

南楼画角 提交于 2019-11-30 10:00:57
Is it possible to launch Photoshop action using code? I mean launch the action in Photoshop via a batch file? Or something like that? Newer versions of Photoshop (CS5 and CS6 are the only ones I've worked with) support a feature called Droplets that lets you create executables to run a set of actions. Check here for detailed information on creating and running the droplet. Will update this answer with the steps shortly. I believe so but I have not tried it myself. The PS6 JavaScript API has a method called doAction() that might be what you are looking for. http://wwwimages.adobe.com/www.adobe

Launch photoshop action using code

邮差的信 提交于 2019-11-29 14:57:08
问题 Is it possible to launch Photoshop action using code? I mean launch the action in Photoshop via a batch file? Or something like that? 回答1: Newer versions of Photoshop (CS5 and CS6 are the only ones I've worked with) support a feature called Droplets that lets you create executables to run a set of actions. Check here for detailed information on creating and running the droplet. Will update this answer with the steps shortly. 回答2: I believe so but I have not tried it myself. The PS6 JavaScript

Photoshop Script: layout images like flickr

心不动则不痛 提交于 2019-11-28 14:39:32
I am looking for a script that would open a given number of images with different aspect ratios and layout them all in a single document like the flickr gallery. Something as seen in this page: http://martin-oehm.de/data/layout.html Is there any script/plugin out there that can do this? The purpose is just to create a reference file with all the images instead of having several images floating around. Thank you The fact that you have had no answers in 10 weeks should tell you that Photoshop is maybe not the best/easiest place to do this.... so, I made the following script that does it pretty