I have a script that runs a batch action on a folder that worked in CS3, but doesn’t in CS5.1.
the error I get is:
Adobe Photoshop CS5.1 got an error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
Can anyone tell me how to fix this? I really miss this script. Thanks for your help.
-- Concatenate text strings for error text file location
set Error_File to "Macintosh HD:Users:grover:Desktop:" & "Image Error Report.txt"
-- Make a text file to write error log to
-- Make the variable to the file an alias (as required by Photoshop)
-- coercion to alias can only be made with a file that already exists
set Error_File to Error_File as alias
-- Choose source of input & get all files
set Input_Folder to "HOM_Shortrun:Process Client Images:" as alias
-- Create a list of files coerced to aliases (as required by Photoshop)
tell application "Finder"
set File_List to (files of entire contents of Input_Folder) as alias list
end tell
--
with timeout of 3600 seconds
tell application "Adobe Photoshop CS5.1"
activate
-- Set your required batch options
set Batch_Options to {class:batch options, destination:none, error file:Error_File, macintosh compatible:true, override open:false, override save:true, suppress open:true, suppressprofile:true, unix compatible:true, windows compatible:true}
-- Run batch command using the above paramitters
batch "resize photo_batch" from "SUPERmerge" from files File_List with options Batch_Options
end tell
end timeout
--
I’ve never really used the batch command but looking at it it seems like a decent feature.
Anyhow i’ve had a play around for 5 mins and the only thing i can see that might be your issue is how PS as changed since version CS4 with how it deals with file paths, i had something similar myself a while back and thats what it turned out to be, so it probably might be the same in this case.
I’ve run this in CS6 and it works up until the batch command which errors cause i hadn’t created one
so i hope it will work with yours.
Have a go with this and see what you come up with hopefully it will work.
-- Concatenate text strings for error text file location
set Error_File to (path to desktop folder) & "Image Error Report.txt" as text as alias
-- Make a text file to write error log to
-- Make the variable to the file an alias (as required by Photoshop)
-- coercion to alias can only be made with a file that already exists
--set Error_File to Error_File as alias
-- Choose source of input & get all files
set Input_Folder to (path to desktop folder) & "Process Client Images:" as text as alias
-- Create a list of files coerced to aliases (as required by Photoshop)
tell application "Finder"
set File_List to (files of entire contents of Input_Folder) as alias list
end tell
--
with timeout of 3600 seconds
tell application "Adobe Photoshop CS6"
activate
-- Set your required batch options
set Batch_Options to {class:batch options, destination:none, error file:Error_File, macintosh compatible:true, override open:false, override save:true, suppress open:true, suppressprofile:true, unix compatible:true, windows compatible:true}
-- Run batch command using the above paramitters
batch "resize photo_batch" from "SUPERmerge" from files File_List with options Batch_Options
end tell
end timeout
--
I have modified it a bit further and can get it to run, but even though it shows the files in the event log as alias, photoshop returns an error that there were no source files that could be opened by photoshop.
I read on the adobe forum that CS5 wants to see files as strings now rather than alias?
I’m not very well versed on scripting. I tend to Frankenstein existing scripts together to do what I need. Not sure how to make this one work.
here’s my current script.
-- Concatenate text strings for error text file location
set Error_File to "Macintosh HD:Users:grover:Desktop:" & "Image Error Report.txt" as string
-- Make a text file to write error log to
-- Make the variable to the file an alias (as required by Photoshop)
-- coercion to alias can only be made with a file that already exists
--set Error_File to Error_File as alias
-- Choose source of input & get all files
set Input_Folder to "HOM_Shortrun:Process Client Images:" as alias
-- Create a list of files coerced to aliases (as required by Photoshop)
tell application "Finder"
set File_List to (files of entire contents of Input_Folder) as alias list
end tell
--
with timeout of 3600 seconds
tell application "Adobe Photoshop CS5.1"
activate
-- Set your required batch options
set Batch_Options to {class:batch options, destination:none, error file:Error_File, macintosh compatible:true, override open:false, override save:true, suppress open:true, suppressprofile:true, unix compatible:true, windows compatible:true}
-- Run batch command using the above paramitters
batch "resize photo batch" from files File_List from "SUPERmerge" with options Batch_Options
end tell
end timeout
I’ve added a small repeat which converst the alias list to strings - Well done for seeing what the problem was!
forgive me - i’ve tweaked the variable names and locations slightly for my own needs
set source_folder to alias "Image Library:Mulityork:Multiyork sofa CGI:FOR DAZ:Dunwich_AD exports:1- Armchairs:"
set Error_File to (source_folder as string) & "Log_Erros.txt"
tell application "Finder"
if not (exists file Error_File) then
make new file at source_folder with properties {name:"Log_Erros.txt"}
end if
end tell
tell application "Finder"
set File_List to (files of entire contents of source_folder) as alias list
repeat with thisRef in File_List
set thisRef's contents to thisRef as string
end repeat
end tell
tell application "Adobe Photoshop CS5"
activate
-- Set your required batch options
set Batch_Options to {class:batch options, destination:none, error file:Error_File, macintosh compatible:true, override open:false, override save:true, suppress open:true, suppressprofile:true, unix compatible:true, windows compatible:true}
-- Run batch command using the above paramitters
batch "Sofa - 348px height" from "ARADRAPE ACTIONS" from files File_List with options Batch_Options
end tell