Removing Alpha Channels

Soilworker

Active member
Does anyone know of a way to automate the removal of non-specifically named channels in PS? I'm trying to write an action that will flatten an image and remove any extra channels (not cmyk). I was hoping that using the quick keys for channels beyond 4 would work but when I use them the action only records the name of the channel instead.

Any ideas? I'm trying to avoid writing a script for this if possible.

Thanks,
Soilworker
 
Attached are three JavaScript files that are very handy for various clean-up activites.

deleteChannels.js
StripExif.js
deletePaths.js


Regards,

Stephen Marsh
 

Attachments

  • Archive.zip
    1.7 KB · Views: 303
Why do you want to avoid using scripts? It's a very powerful way to customize your automation needs. Anyway, on a mac you can try this AppleScript (paste the following code in Script Editor, compile then run):

tell application "Adobe Photoshop CS4"
activate
--next line is to flatten the image
flatten current document
--next 2 lines to look for and delete alpha channels
set kindchan to get kind of every channel of current document
if kindchan contains {masked area channel} then delete (every channel of current document whose kind is masked area channel)
end tell
 
If it requires a script then so be it. I don't particularly have a problem with it - other than I'm awful at scripting. I was only wondering if it was possible without scripting.... which it doesn't appear to be. Looks like I really need to start learning how to write a decent script.

I'll give the AppleScript a whirl as well. Thanks, Colorblind.
 
One final question. Can you recommend a good resource to learn this sort of scripting? I think my preference leans towards JavaScript but AppleScript would be good to learn as well. Would you recommend books, online tutorials etc?

I've gone so long without really needing to know scripting but with the direction my job has taken it would behoove me to learn.
 
Soilworker, over and above the Adobe resources that ship with their products, the following seem to be the most common places to discuss Photoshop scripting:

Adobe Forums: Forum: Photoshop Scripting

Photoshop Scripting Community Forum :: Index

If you are wishing to script InDesign (why no actions!), then you would need to look at different forums.

If you are Mac based, then AppleScript would probably be the easiest to learn, however if you have a web or other coding background and you also use MS Win, then JavaScript is cross platform and a good second choice...with VBscript also being a MS Win only option. It's all Greek to me!

The 3 scripts posted above were originally obtained from the Adobe Exchange site.


Best,

Stephen Marsh
 
Last edited:
One final question. Can you recommend a good resource to learn this sort of scripting? I think my preference leans towards JavaScript but AppleScript would be good to learn as well. Would you recommend books, online tutorials etc?

I've gone so long without really needing to know scripting but with the direction my job has taken it would behoove me to learn.

For online help with AppleScript I'd check out the resources at macscripter.net. Specifically the section for absolute starters.
MacScripter / AppleScript for Absolute Starters

A great printed book is AppleScript 1-2-3 by Sal Soghoian and Bill Cheeseman
Peachpit: Apple Training Series: AppleScript 1-2-3

The big reason to use Javascript for this is that your scripts would be cross platform. On the other hand, AppleScript is probably a little easier to learn.

Shawn
 
I know nothing about Javascript but do agree about the AppleScript links and books suggested by Shawn and Stephen. I would probably start with this PDF: http://files.macscripter.net/sourcebook/AS4ASb2.pdf just to understand the basics of the language. AppleScript is a very important part of my actual workflow. Sometimes I get a bunch of 25-50 InDesign files I have to preflight, make PDFs of and send by ftp or email to various publications. With AppleScript the whole process is a matter of minutes not hours.
 

PressWise

A 30-day Fix for Managed Chaos

As any print professional knows, printing can be managed chaos. Software that solves multiple problems and provides measurable and monetizable value has a direct impact on the bottom-line.

“We reduced order entry costs by about 40%.” Significant savings in a shop that turns about 500 jobs a month.


Learn how…….

   
Back
Top