Run Script in Photoshop

  1. Save javascript as .jsx file.
  2. Start Photoshop with a pictures.
  3. Create an action (Windows->Actions->create new set->create new action)
  4. Press the record button to start recording
  5. Go to File->Scripts->Browse choose the .jsx file
  6. Go to File->Automate
  7. Select the folder of pictures you want to modify with the .jsx file, then select the action you just recorded.

This is a bit like a macro in Excel.