• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Photoshop Scripting - Discussion

Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

Hey Everyone,

 

A before statement: I'm a relatively new coder, especially to JavaScript as I've mostly only done Phython before now.

 

I've been making myself a script for Photoshop as I'm looking to make much more complicated 'actions' as actions are very limited with what you can do. The fist script I'm making is very complicated and I've enjoyed coding it a lot. However, have you noticed that the ScriptUI documentation and the general coding of UI/GUI elements to be rather...messy?

 

Again, I don't have very much experience coding these sorts of things as I've mostly come from a mathematical background for coding. I just seem to be finding it difficult to comprehend all of the different ways to code the same thing and each one is not fully explained in depth with a clear and concise methodology with the various parameters it expects and in what order. It seems to go off on tangents constantly with different ways to doing the same thing instead of fully explaining what it was originally talking about. For example it goes on to say you can do 'undefined' so that you can let the script automatically make the layout for you. Then it doesn't explain what the heck you're meant to or can put in place of that 'undefined' and what parameters you need to put in. Instead you have to then go to a completely different section of the documentation to figure out what it was talking about. There should at least be a link to where you can see all the options. But I'd prefer to know then and there that x: you can do undefined or y: this is your other options. I personally don't want a concise 'guide' on how to make one useless example, but instead I want a 'Documentation' on all the possible things that goes into that slot at the time of you showing me it in the first place. Or at least show me where to find it.

 

Maybe I'm just over-exaggerating and I just need much more practice with coding and I have no clue what I'm talking about. But trying to learn everything at the same time without fully learning each bit of the documentation is rather difficult. I just seem to be jumping around the documentation a lot to try find parts that should be clearly linked to each other.

 

Did anyone else have problems with scripting or is it just a steep learning curve that I've got to climb? Also, do you feel like they need to make a better documentation and method to writing UI elements for their scripts. I could see so much potential of making things with these scripts as I use Photoshop for 99% of my business and being able to make more complex things with it opens up so much to me.

 

Join in the discussion and if you have experience it would be great to hear from you.

TOPICS
Actions and scripting , SDK

Views

676

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

You are also going to find Photoshop Scripting has many limitations believe it not the Action Manager provides a way around the scripting limitations.  Adobe's Photoshop DOM does not cover many things possible in Photoshop. Adobe Provides and optional plug-in names Scriptlistener the you can install in Photoshop.  Once installed anything the can be recorded in an action will be log in two log files on your desktop.  One is logged in VBS code the other in JacaScript Code.  I disable the VBS log by making the file Attribute Read only so it will not be written.  The JavaScript log I control with a Windows Bat command  control its r/w attribute end and clear it.  Like Actions All variable used are hard coded so its step, step, ... step.   However you can replace some of the variable set with hard coded value with variables and create useful script functions. And you can also add logic into Action Manager code.  The code is not easy to read so if you see code in a Photoshop you do not understand right away it is most likely Action manager code.  Action Manager code run faster then DOM code also. So you may see some things that can be coded using Adobe Photoshop JavaScript DOM code being done with Action Manager code ins some places.

 

Tomas Sinkunas posted a script to clean up Action Manager code some to make it easer to use read and use Clean SL

 

 

You should use the Photoshop Scripting forum Photoshop Scripting

Welcome to The Javascript Tools Guide — JavaScript Tools Guide CC 1.0 documentation

ScriptUI object reference — JavaScript Tools Guide CC 1.0 documentation

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

You will not find good examples in documentation that show you how to do some things, even what you can do with some others there are no any samples of. There were few users who thru over last 10 years were figuring out on their own without a lot of help how not explained methods and available scripts can be used to get that noone was aware it might be possible. You can base on their research that was stored on PS-SCRIPTS.COM - Independent Photoshop® Scripting Community and Photoshop Scripting . Additionally you can read unofficial UIScript documentation: ScriptUI for dummies | Peter Kahrel

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

I didn't have much coding before I started learning extendscript, so it was a steep learning curve. Just started out with simple scripts and made them more complicated. The SDKs on extendscript helped and gave me a lot of frustration, as they were difficult to understand, and not everything worked.

As far as the UI and undefined. You can replace undefined with an array for the size of the ui control you want to place. Some like this, I don't. I like to be able to adjust my UI and not have to change all the size arrays - just let PS do it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 06, 2018 May 06, 2018

Copy link to clipboard

Copied

I find Adobe Extension Builder to be quite helpful, but "UI for dummies" makes it easier as well (if you just want one or two popup windows), I highly recommend reading it :  scriptui-2-13-f-2017.pdf - Google Drive . Although I've coded mostly for DTP purposes (file management, divisions and color proofing), it's just enough to make tools in my department   I kind of get what you mean, when you're saying there are places, where putting undefined makes function guess automatically, but docs don't provide full knowledge of what should go there if not null or undefined... In some instances, like in the resizeImage function, undefined can be used to "skip" values and keep original resolution, but in UI things get more complicated, as many elements get a lot of their options in the first argument as a string like: element.add('edittext {preferredSize : [200,200]}', UNDEFINED, ... ), which can be constructed using pointer as well, but leaving second argument undefined most of the time... And there's many more undefined and undocumented. . Although - you don't even have to specify the size, Photoshop can do it for you. I'll post another link as well - it's a nice document with unfolded functions used in Photoshop, I find it very useful: psjscs5.zip - Google Drive . I hope it helps and is revelant it this topic. I'm not a native speaker, so please, don't hate on me

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 09, 2018 May 09, 2018

Copy link to clipboard

Copied

LATEST

All your concerns were the very reason why (A) I've struggled for years trying to wrap my head around Scripting, and (B) I've authored the Professional Photoshop Scripting course 🙂

Best,

Davide

Davide Barranca - PS developer and author
www.ps-scripting.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines