#!/bin/bash # Script to run the comparison JSX script in Photoshop # Change to the script directory cd "$(dirname "$0")" # Path to the JSX script JSX_SCRIPT="test/compare_layers.jsx" # Check if the script exists if [ ! -f "$JSX_SCRIPT" ]; then echo "Error: JSX script not found at $JSX_SCRIPT" exit 1 fi # Function to run the script in Photoshop run_in_photoshop() { local psd_file="$1" local jsx_script="$2" # Construct absolute paths local abs_psd_file="$(cd "$(dirname "$psd_file")"; pwd)/$(basename "$psd_file")" local abs_jsx_script="$(cd "$(dirname "$jsx_script")"; pwd)/$(basename "$jsx_script")" echo "Opening PSD file: $abs_psd_file" echo "Running JSX script: $abs_jsx_script" # Create and run the AppleScript osascript <