I am making an action in Photoshop CC to create a narrow border around images. I chose a foreground color from the image using the eyedropper then recorded the action to

  1. Add new layer called "Border"
  2. Select all
  3. Edit|Stroke, selected 2px inside. The color was the forground one I selected.
  4. Deselect

After recording the action I changed the stroke step to show the dialog in case I want to change the size.

The action worked perfectly for the image I had open when I made it but doesn't for other images. Although I select the border color I want with the eyedropper before running the action, it always uses the color that was selected as foreground when I recorded the action.

Is it possible for the stroke tool in an action to select the current foreground color rather than teh one that was active when it was recorded?

  • 1
    You will need to use a script rather than just the record tool. Nov 8 '15 at 21:19

Actions in Photoshop will not pick a color from an image by itself, and then use it for the task you want it to perform. I would suggest creating separate actions for each color of the border you need. For example:

  1. Action White Border: 2px border, color #FFF
  2. Action Black Border: 2px border, color #000
  3. Action Some random color border: 2px border, color #1b1b1b

Hope this helps.

  • I don't want to have actions that set fixed colours but one that works with the current foreground colour. I'm going to look into scripting for this. Nov 16 '15 at 7:45
  • 1
    Try this link graphicdesign.stackexchange.com/questions/28772/… one person wrote a script similar to what you are looking, but that looks like he knows his way around scripting. You could ask him directly :) Nov 16 '15 at 15:22
  • Thanks, that looks like a good starting point. I'll just need to extend it to allow interactive choosing of the sampling point. Nov 17 '15 at 5:03

I think searching for a script online will help rather than trying with actions,because actions will just repeat all what is recorded. But in script we can define some thing to repeat or create.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.