Skip to main content
Participant
December 1, 2014
Question

Photoshop script for Expand/Contract of Selection

  • December 1, 2014
  • 1 reply
  • 2097 views

Hi!

I need script that will make Expand or Contract Selection for example 1px each time I hit keyboard shortcut. I mean I would like to use this options because I use it very often but I would like without dialog box when PS ask for value of expand/contract. When I will have script for those I could make it by wheel in my Intuos Pro. Now I can't because every time I have dialog box. Thanks in advance for help!

Regards

Arek

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
December 1, 2014

I suspect this may result in a loss of quality compared to a one step expansion.

That notwithstanding you can use Selection’s method "expand" if you don’t want to use Action Manager code.

Something like

app.activeDocument.selection.expand(new UnitValue (1, "px"))

Inspiring
December 1, 2014

What he said. You would also need another one line script to contract:

app.activeDocument.selection.contract(new UnitValue (1, "px"))

Make an Action that calls each script then bind the each action to a keyboard shortcut.

How you map that to your Intuos Pro wheel is left as an exercise to the reader.

c.pfaffenbichler
Community Expert
Community Expert
December 1, 2014

And would one need to check for a Selection first or use a try-clause?