Worked like a charm!
Oddly, I did have to add a bit extra that I don’t understand (like that’s a new thing).
Previously, I was making a new document, pasting the clipboard to it, merging the layers, saving the doc as a JPEG and then closing the doc. Now, with the background layer transparent, I don’t have to merge the layers but, after saving the doc as a JPEG, when I try to close the doc it was pausing to ask me if I wanted to save the document “Untitled-1”, even though I’d just finished saving it and despite having “set display dialogs to never”. Curious. I just had to add “without saving” after the “close document” so it’s no big deal, just curious.
For anyone interested, here’s the quick ‘n’ dirty PhotoShop CS version of the program; in this instance, it steps through 52 alpha channels of the fiche scan of “Captain Marvel #30”, loading and saving each channel as a seperate document:
– program paginate:
tell application “Adobe Photoshop CS” – PS7 code: tell application “Adobe Photoshop 7”
set display dialogs to never
with timeout of 1000 seconds – timeout set high; default setting caused timeout while building histograms
activate
set docInfoRef to info of current document
repeat with n from 1 to 3
set indexPage to {n}
indexPage as string
set myPage2 to ((("Alpha ") as string) & indexPage) as string
if n ? 9 then
set myPage to ((("0") as string) & indexPage) as string
else
set myPage to (indexPage) as string
end if
tell application "Finder"
set myTempFileName to ((("Fire:Documents:Comic Scans:Capt. Marvel:30:30_") as string) & myPage) as string
end tell
load selection of current document from channel myPage2 of current document combination type replaced
-- PS7 code: copy selection of current layer of current document
copy -- PS CS version
set doc to make new document with properties {width:1100 as pixels, height:1530 as pixels, initial fill:transparent}
-- do action "NewDoc" from "Default Actions.atn"
paste -- PS CS version
-- PS7 code: set newLayerReg to paste
-- merge visible layers of current document
set myOptions to {class:JPEG save options, embed color profile:false, format options:standard, quality:12, matte:none}
--save current document in file myTempFileName as JPEG with options myOptions without copying
trim current document basing trim on transparent pixels
save current document in file myTempFileName as JPEG with options myOptions without copying
close current document without saving
end repeat
end timeout
end tell
Thanks very, very much for your help, guys, it’s muchly appreciated.
– Walt Sterdan, Freelance