To whosoever reads this please help!!!
The script that I have is supposed to select all the files in the folder you choose from the script open them in APS and apply the filter from Filter>Distort>Diffuse Glow with settings for graininess, glow amount and clean amount. The script will then save these files in a folder with the added filter and close the original file untouched.
It starts, creates the temp file, opens the first picture file of the group, and then gives me the error "Adobe Photoshop CS got an error: File/Folder expecter.
Could you please take a look at this text and give me any wisdom you have Oh great ones.
Thank you!!!
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 CS"
set display dialogs to never
close every document saving no
end tell
repeat with aFile in filesList
set fileIndex to 0
tell application "Finder"
set theFile to aFile as alias
set theFileName to name of theFile
end tell
tell application "Adobe Photoshop CS"
open theFile
set docRef to the current document
set docHeight to height of docRef
set docWidth to width of docRef
-- Convert the document to a document mode that supports saving as jpeg
if (mode of docRef is not RGB) then
change mode docRef to RGB
end if
if (bits per channel of docRef is sixteen) then
set bits per channel of docRef to eight
end if
set infoRef to get info of docRef
set copyright notice of infoRef to "Copyright 2002-2003, Cool Photoshop Stuff"
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
set fileIndex to fileIndex + 1
set newFileName to (outputFolder as string) & docBaseName & "_" & fileIndex
save docRef in file newFileName as JPEG appending lowercase extension with copying
(filter current layer using diffuse glow) filter with options {graininess:10, glow amount:15, clear amount:15}
set fileIndex to fileIndex + 1
set newFileName to (outputFolder as string) & docBaseName & "_" & fileIndex
save docRef in file newFileName as JPEG appending lowercase extension with copying
-- The original document is closed without saving so it remains as it was
-- when opened for batch processing
close current document without saving
end tell
end repeat
-- Returns the document name without extension (if present)
on getBaseName(fName)
set baseName to fName
repeat with idx from 1 to (length of fName)
if (item idx of fName = ".") then
set baseName to (items 1 thru (idx - 1) of fName) as string
exit repeat
end if
end repeat
return baseName
end getBaseName
Model: Mac G5 2.3
AppleScript: Version 2.1.1 (81)
Browser: Safari 419.3
Operating System: Mac OS X (10.4)