I pieced together a script that determines which side of an image is longest (horizontal or vertical) and runs the corresponding horizontally or vertically oriented photoshop action. With CS5 I keep getting the same error “error “Adobe Photoshop CS5 got an error: File some object wasn’t found.” number -43” Adobe website says it has something to do with Photoshop and the finder having different definitions of “alias” but I still don’t know how to fix it.
I’m an applescript novice at best and I don’t even remember how I put this one together. Please help!
set tempFolderName to "Temp"
set inputFolder to choose folder
tell application "Finder"
set filesList to files in inputFolder
if (not (exists folder ((inputFolder as string) & tempFolderName))) then
set outputFolder to make new folder at inputFolder with properties {name:tempFolderName}
else
set outputFolder to folder ((inputFolder as string) & tempFolderName)
end if
end tell
tell application "Adobe Photoshop CS5"
set display dialogs to never
close every document saving no
end tell
repeat with aFile in filesList
set fileIndex to 0
tell application "Finder"
-- The step below is important because the 'aFile' reference as returned by
-- Finder associates the file with Finder and not Photoshop. By converting
-- the reference below 'as alias', the reference used by 'open' will be
-- correctly handled by Photoshop rather than Finder.
set theFile to aFile as alias
set theFileName to name of theFile
end tell
tell application "Adobe Photoshop CS5"
open theFile
set docRef to the current document
set docHeight to height of docRef
set docWidth to width of docRef
if (docHeight > docWidth) then
do action "Master v1 w/Proof Rotate" from "AWSP"
end if
if (docHeight < docWidth) then
do action "Master v1 w/Proof" from "AWSP"
end if
end tell
end repeat