hi michael,
sorry for the delay in responding to your question. it is a somewhat long winded explanation. i make master files in tiff format that contain many layers and numerous saved selections. i save/archive this master file in it's full uncompresses state. however, i deliver flattened versions of this file (also in tiff format) to my clients with the channels removed. i actually have never played around with the "as a copy" option and didn't realize that it performed these same functions. most of the time, i am working with a whole set of images, in which case i import them into lightroom and then export a set of tiffs and lightroom takes care of fattening and deleting the channels. however, many times, i am editing a single image and it is easier to prep it for the output version while still in photoshop rather than having to import and export a single image into and out of lightroom. i did a little experimenting with the "save a copy" feature which will handles the 2 steps that i was trying to script for but it has a coupe of drawbacks. almost always after flattening and deleting the extra channels, i also crop, crop with perspective or use image/distort/lens correction to adjust the vertical and horizontal lines (i photograph architecture primarily) and then finally, i sharpen the image. if i use the "save as copy" method it seems like i will have to either do all of these things prior to using "save as copy", or i will have to close the current master file and then re-open, process, and re-save the image. i could use the "save as copy" method after fully processing the image, but the disadvantage is that it can be very slow to use the lens correction filter on an unflattened 400mb master as opposed to a 60mb flattened image.
while both methods are an improvement over my current workflow, neither the script, nor the "save as copy" method solve my entire problem. ideally, what i would like to do is have a script that will flatten the image, delete the channels and then save the new file in the same location as the original (but not as a copy because i would still like to have the new file open so that i can perform the last few steps before closing). with the "save as copy" method it will always either save the file to the same folder that was designated when the script was recorded (if i opt for perform without dialog), or it will require me to navigate to the current desired folder each time (if i use the dialog). additionally, instead of adding "copy" to the end of the name, i want the last 7 characters of the original file name ("_master") deleted from it before saving the new file. i hope that is a clear explanation. it really only adds up to probably 5-10 seconds of difference from doing all of this manually but as i process several thousand files a year so being able to keyboard shortcut an action that would run the appropriate script would end up saving me a decent amount of time in the long run. anyway, would you happen to know if a more advanced script would be capable of all this? any additional thoughts would be much appreciated.
all the best,
john h.