TechBuzzPro

Photoshop Scripts Can't Process Open Images? Fix It

· 5 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

A Photoshop script cannot process an open image when it targets the wrong document, runs in the wrong mode, or lacks permission to reach the file. The fastest fix is to make the script act on the active document explicitly, confirm the document is not a smart object or in a modal dialog, and run the script from a trusted folder with the correct Photoshop version. Below is a practical, step-by-step way to diagnose and resolve the problem.

What You'll Need

  • Photoshop installed and updated to a current version (menu labels can differ slightly by version, device or region).
  • The script file (.jsx or .js) saved in a local folder you control, not inside a read-only application directory.
  • Basic ability to open the script in a plain text editor to check its first lines.
  • Administrator access on the computer if you need to change folder permissions.

Step-by-Step

  1. Confirm the image is actually open and active. Click the image window so its tab is highlighted. A script that references app.activeDocument will fail if no document is active or if the focus is on a panel. If the image is open but greyed out behind a dialog, close the dialog first.
  2. Check for a blocking dialog. Photoshop scripts pause while a modal dialog is open (Save As, Camera Raw, Liquify, Export As). Close any open dialog, then run the script again.
  3. Open the script in a text editor and look at the document reference. If the first lines use app.activeDocument, the script depends on the front-most image. If they use app.documents[0] or a hard-coded file path, the script may be looking for a different file. Change the reference to the active document or open the file the script expects.
  4. Verify the document mode and layer type. Some scripts fail on 32-bit documents, CMYK files, or smart objects because the commands they call are not available. Flatten a copy (Layer > Flatten Image) or convert the mode (Image > Mode > RGB Color) and try again on the copy.
  5. Run the script from File > Scripts > Browse. Do not double-click the .jsx file from the desktop, because that can launch a different application or a second Photoshop instance. In Photoshop, choose File > Scripts > Browse, select the script, and click Open.
  6. Check the script's folder permissions. If the script reads or writes files, place it and its input/output folders somewhere your user account can write to, such as Documents. Avoid Program Files and system folders.
  7. Enable the correct scripting option. In Photoshop, open Edit > Preferences > Scripts (Windows) or Photoshop > Settings > Scripts (macOS) and confirm that the option to allow scripts to access the network or local files is set as your workflow needs. Labels can differ by version.
  8. Test with a minimal script. Create a new text file containing alert(app.activeDocument.name);, save it as test.jsx, and run it via File > Scripts > Browse. If the alert shows the file name, the scripting engine is working and the problem is inside the original script. If it errors, the issue is Photoshop-level, not the script.
  9. Reinstall or repair Photoshop if the scripting engine itself fails. Back up presets and actions first. A repair install keeps your documents but may reset preferences, so note any custom settings.

Common Mistakes

  • Running a script while a different document is active, so it edits the wrong file or reports that no document is open.
  • Double-clicking the .jsx file instead of using File > Scripts > Browse, which can open the script in a browser or text editor.
  • Editing the script in a word processor that adds curly quotes or hidden formatting, which breaks JavaScript syntax.
  • Assuming every script works on smart objects, 32-bit files, or CMYK documents; many do not.
  • Leaving a modal dialog open and wondering why the script appears to hang.
  • Saving the script in a read-only folder, so it cannot write its output.

Tips

  • Keep a copy of the original script before editing, and change one line at a time.
  • Use File > Scripts > Browse every time; it is the most reliable way to run a .jsx file.
  • Work on a duplicate of the image (Image > Duplicate) while testing, so a failed run cannot damage the original.
  • If a script was written for an older Photoshop version, check whether it uses commands that have since been renamed or removed.
  • Name scripts without spaces or special characters to avoid path problems.

Troubleshooting

If the script still will not process an open image, work through these checks in order. First, restart Photoshop and try the minimal test script again; this clears a stuck scripting state. Second, confirm the document is not in a mode the script cannot handle by duplicating it and converting to RGB 8-bit. Third, check the JavaScript error message: a message about activeDocument means no document is active, while a message about a missing file means the script is looking for a path that does not exist. Fourth, move the script and its working folder to Documents and try again. Fifth, if the script uses external libraries, confirm those files are in the same folder. Finally, if nothing works, open the script in a text editor and compare its document reference with the file you have open; adjust the reference or open the expected file. Do not factory-reset Photoshop until you have backed up actions, presets and preferences, because a reset removes them.

Frequently Asked Questions

Why does my script say no document is open when one is?

The script is probably referencing a specific document index or path that does not match the open file. Make the image active and check the script's first lines for app.activeDocument versus a hard-coded name.

Can Photoshop scripts process smart objects?

Some can, but many commands require a raster layer. Rasterize a copy of the smart object (Layer > Rasterize > Smart Object) and run the script on that copy.

Do scripts work on 32-bit or CMYK documents?

Not all of them. Convert a duplicate to RGB 8-bit (Image > Mode) and test there. If it works, the original mode was the limitation.

Why does double-clicking the .jsx file not run it in Photoshop?

The file association may point to another application. Always run scripts from File > Scripts > Browse inside Photoshop.

Where should I save a script so it can write output?

Save it in a folder your user account can write to, such as Documents. Avoid Program Files and other protected system folders.

Does a modal dialog stop scripts?

Yes. Close Save As, Camera Raw, Liquify and similar dialogs before running the script, or it will wait until the dialog is dismissed.