11 Replies Latest reply on Apr 28, 2011 12:41 PM by SuperBeer Dude

    Is This Possible To Do?

    SuperBeer Dude

      Lets say I'm writing an Action that instructs the user at a certain point to select a foreground color they intend to use.  Later in this action I'd like the action to select the user selected "foreground color" and fill a selection, channel, etc., with the chosen foreground color.  I've tried countless things and can't get this to work other than have the action fill a selection with a specific RGB value.  What I need to incorporate is a command to simply "select current foreground color" and fill the selection with the correct RGB value indicated by the user.  Any clues?

        • 1. Re: Is This Possible To Do?
          thebestcpu Level 1

          I may be missing something in your request.

          Why not use the Edit > Fill Commnad and set it to use the Foreground Color.   When I do that the Action logs that it should use the foreground color and not a specific color.

          Does that meet your need and if not please provide more details.

          Hope that helps.

          John

          1 person found this helpful
          • 2. Re: Is This Possible To Do?
            SuperBeer Dude Level 1

            That doesn't work as when the new channel dialog box pops up, it always contains the incorrect color and fills the channel with the previous foregound color chosen, not the color chosen by the user.

            • 3. Re: Is This Possible To Do?
              SuperBeer Dude Level 1

              To clarify, if the user has chosen a color using the action and used it to fill a channel, upon running the action "again" the New Channel dialog box remembers the previous color and not the new color chosen even when using Fill Using Foregound Color within the action.  I've tried many things such as resetting the swatches, purging, etc to no avail.  The previous foreground color remains.

              • 4. Re: Is This Possible To Do?
                SuperBeer Dude Level 1

                FYI:  Edit/Fill/Foreground Color only works when working with a new Layer or selection within a Layer to fill, not Channels.  Anyone???

                • 5. Re: Is This Possible To Do?
                  Michael L Hale Level 5

                  If I understand what you are asking you should be able to record an action that uses the foreground color without recording the color used by using the 'fill with foreground color' keyboard shortcut( alt-backspace on Windows, not sure about Mac ). That should work with layers, channels, and/or selections.

                  • 6. Re: Is This Possible To Do?
                    thebestcpu Level 1

                    On the Mac, to fill with foreground it is Opt + Backspace

                    • 7. Re: Is This Possible To Do?
                      thebestcpu Level 1

                      I think I see what you mean now.  When setting up a new channel and you want to select the color for the masked (or not masked) area, it records a set color as opposed to being able to choose the present foreground (or background) color.

                       


                      Sounds like a case for script to substitute for that one action step.  Using Scriptlistener you can record the steps for that action and then substitue a varialbe for the mask color input and just set the varible to the foreground color first in the litlle script.  I could not find a way to do it just with Actions either.

                      1 person found this helpful
                      • 8. Re: Is This Possible To Do?
                        JJMack Most Valuable Participant

                        I do this by adding a stop. "Did you remember to set the forground color? If yes click continue else click stop now select the forgound color and click Play in the actions palette.

                        • 9. Re: Is This Possible To Do?
                          SuperBeer Dude Level 1
                          function(){return A.apply(null,[this].concat($A(arguments)))}

                          thebestcpu wrote:

                           

                          I think I see what you mean now.  When setting up a new channel and you want to select the color for the masked (or not masked) area, it records a set color as opposed to being able to choose the present foreground (or background) color.

                           


                          Sounds like a case for script to substitute for that one action step.  Using Scriptlistener you can record the steps for that action and then substitue a varialbe for the mask color input and just set the varible to the foreground color first in the litlle script.  I could not find a way to do it just with Actions either.

                          I had a feeling using Actions alone to do this was impossible.  I'll have to look into using Scriptlistener and doing it as a plugin.  Still have a difficult time generating those as there's very little documentation out there and the Automation tutorial included with the SDK is outdated.

                          • 10. Re: Is This Possible To Do?
                            JJMack Most Valuable Participant

                            If your just starting to learn Photoshop Scripting start by reading the documentation that ships with Phitoshop do not start with the ScriptListener Plugin like actions that that produces Step, Step, Step no logic. If you want to prompt the user to enter a color you need to add the logic using a supported script language like javascript. Script documentation ships with Photoshop for example if you are a Windows CS5 read these:

                            "C:\Program Files\Adobe\Adobe Photoshop CS5\Scripting\Documents\Photoshop CS5 Scripting Guide.pdf"

                            "C:\Program Files\Adobe\Adobe Photoshop CS5\Scripting\Documents\Photoshop CS5 JavaScript Ref.pdf"

                            There are some good tutorials on the web I started with these:

                            http://morris-photographics.com/photoshop/tutorials/scripting1.html

                            http://morris-photographics.com/photoshop/tutorials/scripting2.html

                            There is this forums and others over at http://www.ps-scripts.com/bb/

                            You can do what you want in an action by adding an action Stop like I described in my previous append.

                            I also have a free download on the Web about crafting actions it contains a dozen scripts to be used within Actions.

                             

                            http://www.mouseprints.net/old/dpr/JJMacksCraftingActions.zip

                            Contains:

                            Action Actions Palette Tips.txt

                            Action Creation Guidelines.txt

                            Action Dealing with Image Size.txt

                            Action Enhanced via Scripted Photoshop Functions.txt

                            CraftedActions.atn Sample Action set includes an example Watermarking action http://www.mouseprints.net/old/dpr/WM900x600.jpg

                            Sample Actions.txt Photoshop CraftedActions set saved as a text file. This file has some additional comments I inserted describing how the actions work.

                            12 Scripts for actions

                            • 11. Re: Is This Possible To Do?
                              SuperBeer Dude Level 1

                              JJMack, thanks for the information.  Very much appreciated.