Skip to main content
Participant
August 9, 2024
Answered

Photoshop Actions Corrupting & Path Issues with JSX Scripts for Automated Cropping

  • August 9, 2024
  • 2 replies
  • 516 views

Hi everyone!

 

I’m working on a Photoshop action set that crops images to specific aspect ratios (like 1:1, 9:16, etc.), then saves the cropped image with a suffix (e.g., _1-1) into a subfolder (like 1-1, 9-16, etc.) within the original image’s directory. I’ve got it working pretty well for myself using the following steps:

 

Action Workflow:

•Image Size Adjustment

•Crop (paused for customization)

•Load 1-1.jsx (to create the new folder and save the file with the correct suffix)

•Revert to the original state

•Close

 

The challenge I’m facing now is how to distribute this action set so others can use it easily on their own systems.

 

The Problem:

When I save the action (1-1.atn), it saves the absolute path to the 1-1.jsx script. This becomes an issue when others try to use the action, as the path is specific to my setup. Ideally, I’d like the path to be relative, but I understand that’s not possible with Photoshop actions.

 

What I’ve Tried:

1. Manual Path Correction:

•I attempted to manually update the paths in the .atn files via JSX, but this led to file corruption.

2. Dynamic Path Resolution:

•I created a JSX script to dynamically find and update paths for the scripts. However, this approach caused issues with the .atn files not loading correctly.

3. Simplified JSX Script:

•I made a basic 1-1.jsx script to handle the file saving with the correct suffix and folder structure. This works fine, but integrating it into the action in a user-friendly way has been tricky.

4. Testing Script Installation:

•I tried creating a setup.jsx script to install the actions and scripts automatically, but ran into problems with paths not updating correctly and actions not appearing in the Actions panel.

 

I’m looking for a reliable way to package and distribute this action set so that the paths to the JSX scripts update automatically for any user, regardless of where they place the files on their system. 

 

Thanks in advance for your help!

This topic has been closed for replies.
Correct answer Stephen Marsh

Install the .jsx files in the application folder under Presets/Scripts, restart Photoshop and then you can record the action step from the File/Scripts menu – it will record as just the script name, not the absolute path.

 

Using Browse in the action recording will always use an absolute path tied to the original computer recording the action.

 

 

Hybrid action/scripts can be more complex and problematic for distribution, so fully scripting the process without the action is often preferred.

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

 

2 replies

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
August 9, 2024

Install the .jsx files in the application folder under Presets/Scripts, restart Photoshop and then you can record the action step from the File/Scripts menu – it will record as just the script name, not the absolute path.

 

Using Browse in the action recording will always use an absolute path tied to the original computer recording the action.

 

 

Hybrid action/scripts can be more complex and problematic for distribution, so fully scripting the process without the action is often preferred.

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

 

Participant
August 11, 2024

That worked! Thanks, I now created a .exe file and a mac executable to copy the files to the scripts and actions folders and launch the .atn. That seems to work great, I now have some problems adressing older versiond of Photoshop. But I don't think that's a question for here.

Legend
August 11, 2024

Both Apple and Microsoft have installers you can use free of charge. There are plenty of third-party ones as well. Plus the Adobe Exchange method.

Legend
August 9, 2024

Adobe has specified folders for scripts to be loaded. You (or your users) can install those manually or using the system on Adobe Exchange, which involves a manifest and signing your distribution package. You can also run scripts via File->Scripts->Browse.

If you want to use UXP, you can have Batchplay or standalone .jsxs scripts which work a bit differently.