title: From Photoshop actions to Photoshop scripting?
body: <p>I would like Photoshop to automatically execute the following task for a given folder:</p>
  
  <ol>
  <li>Load all PNG files in a given folder. </li>
  <li>Convert each file's mode to <code>RGB color</code></li>
  <li>Add one layer to each file</li>
  <li>Save the files as PSD in the same folder</li>
  </ol>
  
  <p>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.</p>
  
  <p>One thing I know is that I can't run the task above using <code>Actions</code> 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 macro (instead of the one used to load the original PNG files). In other words, it fixes the destination folder to the one used in the macro.</p>
  
  <p>This takes me to the following question: <strong>Is there a way to automatically generate the Photoshop Javascript code that runs a given action</strong>? </p>
  
  <p>If so, I wouldn't mind learning how to modify the script to fix the above folder problem.</p>