Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all 12244 articles
Browse latest View live

Passing arguments to the jsx file from command line

$
0
0
Thanks for taking my question.

I am using the following to be able to run my script from the command line.In case you were wondering on why i would be doing this- i would need to invoke the javascript from a server side code(like java,php etc. in my case it is java)

"c:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit\ExtendScript Toolkit.exe" "c:\path to script\myscript.jsx"

Anyways, i have been successful in running the myscript.jsx from the command line but i am not able to figure out how i could pass arguments to "myscript.jsx" from the command line, and be able to refer to these arguments within the script.

I have tried the following

"c:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit\ExtendScript Toolkit.exe" "c:\path to script\myscript.jsx" "argument1" "argument2"

and tried to refer these arguments within the script using arguments[0] and arguments[1] . But looks like this does not work.

Any thoughts?????

Suspend History States

$
0
0

Is there a way to stop the steps in a script showing up in the history.

 

I have seen other posts talking about suspendHistory but `i am not that familiar with how to use that call

Image Processor Pro 3.2b1 beta released

$
0
0

Image Processor Pro 3.2b1 beta has been released can be found here: ps-scripts - Browse /Image Processor Pro/v3_2b1 at SourceForge.net

 

This port is compatible with PS CS5 through CC2015. Besides the port, a few more requested features are being added.

 

If you find any problems or have any requests, post them here or email me at the address in the README file.

 

-X

Color picker foreground color in the layer

$
0
0

I'm doing a job where I need to know the color used for that level

according to you can you do?

 

this and an example.

Schermata 2017-10-23 alle 15.42.37.png

Save For Web Animated GIF - with saved settings script.

$
0
0

I've automated via actions and a macro to save out a single PSD setup for animation as a GIF in 11 different languages. The languages are defined within the source PSDs on layers. There are about 70 PSDs in total with different dimensions (same animation) but different composition based on dimensions - The actions turn on and off said layers and export.

 

Actions:

Turn off layer (language one)

Turn on layer (language two)

>Export (with dialog on)

Macro takes over and appends an underscore and a 2 character code for language like _EN at the end of the file name for language. Then saves.

 

The actions repeat until the full run of languages are exported. 11 in total for 70+ PSDs

 

My biggest hangup is that I have to save the GIFs to a particular file size limit - Like 300kb for example. So for each PSD with a particular dimension - I set up the file previous to exporting, then "Save for Web",  Optimize, and click Done to bake the optimization into the PSD. Which works great. All I have to do then is run my action once and run a macro - then sit back until it completes. What I have noticed is that having to have the dialog window come up for "Save for Web" can take at times, minutes to fully show as it tries to preview. Which eats up a lot of time throughout the entire process.

 

The problem I face is that I have to invoke the "Save for Web" dialog box for each language so that the macro can take over, and append the lang code at the end of the filename along with keeping the baked in optimization setting for each PSD.

 

I have used the ScriptListener to see whats going on to try and script some of this process to bypass the "Save for Web" dialog window. But every time I try to test it out based on the JS that's spit out.. The baked in optimization settings are no longer used.

 

I'm not looking for someone to write the code for me, but rather some direction on how I could potentially achieve a more streamlined way. That said I'm not a coder, but am not afraid to get my hands dirty.

 

If I could remove the use of macros for file naming and the "save for web" dialog window I could shave hours off this daunting process. I have used variable datasets for another case where just text is changed, and when exporting animated GIF without any file size limitations - I was able to generate updated PSDs, and export animated GIFs (with no use of the "save for web" dialog window) in under 10 minutes. So it got me thinking I could potentially refine my other process further and save heaps of time. There doesn't seem to be a lot of information with scripting the "Save for Web" for animated GIFs with saved settings. Any information on this would be greatly appreciated.

 

Thanks!

Chris

Export Layers to Files: How to keep canvas size

$
0
0

Hello

 

I need to export hundreds of layers to PNG-Files.

Unfortunately the Script crops to the layer's boundary so every file has different dimensions. How to keep the canvas size of the PSD in the exported files?

 

Thanks for your help

 

PS-Version: MacOS, CS 5.1

converting actions into script

$
0
0

Hello Guys,

 

Might be a quick answer for you or maybe not.

I have never scripted anything in my life (except a few macro files in excel) and I am green to this.

 

Simple question - I have a few "actions" in photoshop and I would like them to be converted into scripts as it might come handy for the future as I will be working with some scripters.

So how do I transform this ATN file into a script?

 

The reason behind it is that I am already having one action that has 2 scripts in it and in the future I want to add more, so I will need someone scripting to work on the script itself not actions.

 

Maybe it is also counter-productive so give me your opinion,

 

thanks.

 

Olaf

Script to Create Folders Using Photoshop Scripting Mac/Windows

$
0
0

Can anyone help me. I want to create a script to create folders and run the script in Photoshop.

 

I am a real novice at scripting and I do not know if this can be done.

 

Thanks


open file as or convert layer as : Smart Object

$
0
0

Hello,

 

I have a script that among the things, inserts a watermark into an open image.

I would like for this watermark to be added as a smart object before resizing it.

 

this is what I am currently doing to add the watermark image, resize it and change the opacity:

 

...

// add watermark
var theFiles = [];
var theNames = [];
theFiles[0] = '/Applications/Adobe Photoshop CC 2017/Presets/Scripts/watermark.png';
theNames[0] = 'WATERMARK';

for (var m = 0; m < theFiles.length; m++) {   // open document  var fileRef = new File(theFiles[m]);  var idoc = open(fileRef);  // get document name (and remove file extension)  var name = theFiles[m];  name = name.replace(/(?:\.[^.]*$|$)/, '');  // convert to RGB; convert to 8-bpc; merge visible  idoc.changeMode(ChangeMode.RGB);  idoc.bitsPerChannel = BitsPerChannelType.EIGHT;  idoc.artLayers.add();  idoc.mergeVisibleLayers();  // do the resizing.  idoc.resizeImage(UnitValue(watermarkWidth,"px"),null,null,ResampleMethod.BICUBIC);  // rename layer; duplicate to new document  var layer = idoc.activeLayer;  layer.name = theNames[m];  layer.opacity = 30;  layer.duplicate(doc, ElementPlacement.PLACEATBEGINNING);  // close imported document  idoc.close(SaveOptions.DONOTSAVECHANGES);
}

...




...

 

how can I convert the watermark to a smart object before resizing and changing opacity?

Timer counter for a custom animation timeline

$
0
0

So I'm trying to playback the layers, to shuffle trough them in specific intervals of time - therefore creating something like a "Play" functionality that we have in the timeline panel. My idea was to use something like this:

 

for (i=0; i<animationLength; i++) {

        $.sleep (1000/framerate);

        shuffleLayer();

        }

 

The problem with this is that the phothoshop hangs while the script is not fully executed, so I cannot see the changes on every loop iteration. So I've tried introducing the app.refresh() function:

 

for (i=0; i<animationLength; i++) {

        $.sleep (1000/framerate);

        shuffleLayer();

        app.refresh();

        }

 

And aldough, this works, the refresh function is very slow. It takes around a full second to execute one for loop iteration. It's not really usable for thing like this. I also tried using 'while loop' with date measurement, but I still have the same problem. Does anyone know is there a better approach for something like this?

Watch Folder

$
0
0

Hello,

 

Is there a way to have Photoshop watch a folder for new images and run some actions on the newly added files - after which removing the original from that folder.

 

I need to automate the follwoing:

Image is added to watch folder

Photoshop

  1. Detects new image
  2. Opens image
  3. Runs actions
  4. Saves to a new directory

File is deleted from watch folder.

 

I am on Mac 10.7 and have Automator at my disposal. I'm also familiar with scripting but not specifically for Photoshop so I prefer scripting would be the last resort.

 

Any help or guidance is greatly appreciated.

 

Thank you!

 

V

How to Package and Distribute Scripts + Actions?

$
0
0

I'm already enjoying some success at distributing an interworking set of actions and scripts. BUT there are several barriers that I'm sure others have thought about solving, and I'd like to get an idea what the possible (and best) solutions might be.

 

Let's start with the following assumptions, based on my sales so far:

 

  • The target audience has Photoshop CS2 up to Photoshop CC.  (For me, so far, MOST people are CS5, CS6 or CC). An ideal solution would allow me to continue to target all of these people.
  • The target audience are Photoshop "aware" but not Photoshop "Savvy".  They want tools to do a specific job and may not know all the ins and outs of Photoshop.
  • In addition to supporting a wide variety of Photoshop versions, we must also support both Mac and PC users and the variety of OS's that are present in the wild.

 

Currently the "state of the art" as I understand it are the following:

 

  1. Sell actions or scripts with a set of instructions about where to copy the items, being careful to describe the differences for different machines and OS's and Photoshop Versions.
    PROBLEM:
    A. This is unwieldy and requires the consumer to be more "savvy" about their OS and their Photoshop than many people are.
    B. Many versions of windows do not allow one to copy into some directories without special privileges, ditto for the Mac.

  2. Package the actions or scripts for Mac separately from those for the PC and bundle each with some kind of installer.
    PROBLEMs:
    A> Multiple packages are harder to maintain 
    B> "canonical locations" for the PC are different than on the Mac 
    C> There are security problem with creating and distributing a an installer. While it may be easier to send a bundle around, it moves the burden to the user who has to know what "this app is not trusted" means and how to circumvent it.
    D> some users, especially CC users who have more than one platform may want both Mac and PC versions.

  3. Figure out how to slog through the process of getting something into "Adobe Exchange"
    PROBLEMS:
    A. The process seems inscrutable to me.
    B. "Exchange" is an additional Product that someone must install (not included with Photoshop)
    C. Does no support older versions of Photoshop (before CS5, i believe)
    D. Apparently requires a different package for EACH supported Photoshop version?? True?
    E. Given that Exchange is not bundled with Photoshop the market is stacked against someone who adopts this route.
    F. Exchange itself is sometimes a pain. For example just now it told me I needed to update it *and* restart Photoshop.  It's hard to imagine a potential customer going through that much pain to try to find a package there. Besides after all that I clicked "My Stuff" and the tool sat spinning infinitely.
    G. The user must KNOW about exchange, and I, the seller have to describe how they can navigate that landscape, that is once in Exchange a user has to somehow FIND your content.
    H. There seems to be no clarity about what percentage Adobe is taking in this model, or how payment will work.
    I. Users must be willing to use an Adobe ID to make a purchase.
    J. Based on what is currently in exchange, it seems a poor vehicle to get eyes as there is very limited ability to put text and descriptions
    K. There is obviously a very low incidence of people looking in Exchange... NONE of the products I saw there had even ONE review!

  4. Create something that uses Adobe Configurator (could be in addition to or a replacement for any of the above)
    PROBLEMS:
    A. Configurator is DEFINITELY Photoshop version specific. Lots of overhead building and testing for each supported PS.
    B. As near as I can tell, Configurator is a dead project that has no team and no support.
    C. Doesn't support earlier Photoshop versions.  (CS4? unlikely)
    D. Still requires that a user stall an "Administrator Required" Adobe Extension Manager tool.

  5. Join the Apple Developer program so you can build, sign and distribute a package for the Mac including, possibly, via the Mac Store.
    PROBLEMS:
    A. Might work for the Mac, but doesn't help much for the PC which is 60% of the market.
    B. More $ and pain. Though perhaps worth it as the Mac store (like the App store) get's a LOT more eyes than whatever Adobe has cooked up so far.
    C. Seems like a lot of work and hassle to distribute Photoshop specific content.

 

As near as I can tell there is no solution for "upgrades" (distributing newer versions) or "upsells" for any of the above options. 

 

Is there an option 6?  Have I misstated something? Does Adobe indeed have a "Photoshop script/action bundle maker' which is platform independent, robust and EASY for anyone to use?

scale layer to current canvas size photoshop

$
0
0

I've been googling, and reading, but I have not been able to find an action, or method to select a layer, and have it scale to the canvas size? This seems to be something that should be built in?

 

Anyone know of a script or action I can use?

 

Sometimes it needs to scale up or down.

 

And I don't need to keep the proportions. Just scale to fill.

 

Thanks for your help

 

Maxi

 

PS: I know in Russell Brown's Paper Texture extension, the loaded layers are scaled to fit the canvas.

[CS6] Custom Panel hook for C++ API question

$
0
0

I have a plugin (.dll) written in C++ that I want to create a custom panel for, so a few questions:

Is this possible?

If so, could you point me in the direction of what I have to use, I understand that I can use ActiveXObject for web to call native dlls in Js. Would this work for Photoshop?

Script to open the Open Dialog Window

$
0
0

Hello everyone!

I'm new to scripting and this is probably an easy question but I'm trying to write a script that opens the Open Dialog Window. Basically I need to start the script in one active document, have the script open the Open Dialog (to let the user select another image) and then finish the script in the newly opened document. Every script I find is to open a specific file, but I need it to be User Selected through the Open Dialog of Photoshop.

 

I hope that makes sense! LOL. Any help would be greatly appreciated!

 

Thanks,

Bradi


Photoshop CC 2018 - extended script - View mode issue

$
0
0

Dear Photoshop forum,

 

I’m noticing an issue with Photoshop CC 2018 and the extended script “.jsx” file I developed for Photoshop CC 2017.

 

My script works perfectly in Photoshop CC 2017 and both it's view modes “Standard screen mode” and “Full screen mode with menu bar”. In Photoshop CC 2017 I can launch the script and it returns a dialog that can be changed and its changes return a dialog with the corresponding changes.

 

In Photoshop CC 2018 my extended scripts works perfectly fine while in  the “Standard screen mode”. But while I’m in the “Full screen mode with menu bar” the dialog goes blank. When I move the mouse over the dialog some of its interface items are brought back but the majority of it remains blank. If I change a menu item that is shown by the mouse it makes the appropriate modifications.

 

It appears that the dialog's interface is being overwritten by the “view modes” white background while in “Full screen mode with menu bar”.

 

Is there something I need to add to my script so that it works properly?

 

Thanks

Rob

 

Screen Shot 2017-10-22 at 8.58.45 AM.png

Script for deleting Hidden Layers which are not used in any Layer Comp?

$
0
0

Hello.

 

I've turend the web upside down searching for a script that would do the following:

 

  1. Search through all the layer comps in the document
  2. Check which layers are hidden on all Layer Comps
  3. Remove/mark with color the layers found.

 

If anybody can provide a script that would do such a thing - it would be highly appreciated.

 

Regards,

Fade.

How to export layer files as PNG'S AT 300 DPI from photoshop?

$
0
0

Hi there,

 

I am using Photoshop CS6 and desperately trying to export individual layers from a photoshop file as PNG'S at 300 DPI. When I go File>Export>Layers to Files, it automatically resizes them to 72 dpi. I have tried to copy and paste new info into the 'Layers to files' script file but all that did was being to export them as PSD's.

 

Any help with this would be greatly appreciated!

 

Thanks in advance.

 

Madeline.

Automatically run scripts on files in a specific folder

$
0
0

Hello all!

 

I have a series of very effective scripts that I am running against a series of photoshop files. Now the big quiestion!

 

Is there a program to

1) "watch" a folder, so when a file is saved in that folder.

 

2) It runs my script(s) on that file?

 

If you look at it simply-- I would like to replace the "drag and drop" method used for droplets, with the "drop in the folder" method.

No doubt this would require a separate program, to consistently check the folder for new files.

 

This is something that I would prefer to tackle with python, but maybe you all in the community could provide me with a more "industry accepted" solution?

 

Oh and Ideally I would run this on both mac and PC.... though I understand if windows makes more  sense for an operation like this.

 

Best,

Thomas Murphy

Script avec fichier excel

$
0
0

Bonjour,

 

Je désespère de trouver une solution ...

 

J'ai 500 photos et 10 scripts.

 

Je voudrais appliquer a chaque photo un certain script.

Ex

Photo 1 = Script 2

Photo 2 = Script 6

Photo 3 = Script 3

Photo 4 = Script 1

Photo 5 = Script 10

Est il possible de le faire en créant un fichier txt pour lui indiquer les association a faire ?

 

Merci de votre aide

Viewing all 12244 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>