Results 1 to 9 of 9
  1. #1
    Soilworker is offline Member
    Join Date
    Sep 2007
    Posts
    33

    Question Removing Alpha Channels

    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

  2. #2
    Stephen Marsh is offline Senior Member
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    493

    Default

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

    deleteChannels.js
    StripExif.js
    deletePaths.js


    Regards,

    Stephen Marsh
    Attached Files Attached Files

  3. #3
    Soilworker is offline Member
    Join Date
    Sep 2007
    Posts
    33

    Default

    Thanks, Stephen. I'll be sure to check out the scripts.

    ~Soilworker

  4. #4
    Colorblind's Avatar
    Colorblind is offline Senior Member
    Join Date
    Aug 2007
    Location
    Montreal, Qc, Canada
    Posts
    324

    Default

    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
    Better train people and risk they leave - than do nothing and risk they stay.

  5. #5
    Soilworker is offline Member
    Join Date
    Sep 2007
    Posts
    33

    Default

    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.

  6. #6
    Soilworker is offline Member
    Join Date
    Sep 2007
    Posts
    33

    Default

    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.

  7. #7
    Stephen Marsh is offline Senior Member
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    493

    Default

    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 by Stephen Marsh; 02-17-2010 at 12:15 AM.

  8. #8
    Shawn is offline Senior Member
    Join Date
    Aug 2007
    Location
    Topsham, Maine
    Posts
    189

    Default

    Quote Originally Posted by Soilworker View Post
    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

  9. #9
    Colorblind's Avatar
    Colorblind is offline Senior Member
    Join Date
    Aug 2007
    Location
    Montreal, Qc, Canada
    Posts
    324

    Default

    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.
    Better train people and risk they leave - than do nothing and risk they stay.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Sponsors