tell application "Finder" to set myTempFileName to (home as string) & "Desktop:"
tell application "Adobe Photoshop CS"
activate
set display dialogs to never
set ruler units of settings to pixel units
set docRef to the current document
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
tell docRef
delete (every channel whose kind is not component channel)
set newFileName to myTempFileName & docBaseName & "_Apendage"
save docRef in file newFileName as Photoshop format with options ¬
{save layers:true} appending lowercase extension with copying
end tell
close current document without saving
end tell
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