Skip to main content
Inspiring
June 20, 2020
Question

Can you select a Brush group programatically using Javascript

  • June 20, 2020
  • 1 reply
  • 281 views

I have a script that loads a Brush group at the start of processing.

I want to unload/delete that group on completion.

I have the code (via ScriptListener) to perform the delete, but it delete the "current" (actually the currently selected, i.e., highlighted) Brush group.

On completion of the processing, the Brush group is apparently (by manual inspection) not selected (highlighted), so the code doesn't delete it, albeit it executes without reporting an error, possibly because there is no selected Brush group to delete - no Brush group is selected (highlighted).

ScriptListener does not show any code resulting from a manual selection of a Brush group.

There appears to be no way to test whether a particular Brush group is loaded.

Consequently, repeated execution of the script results in multiple instances of the Brush group accumulating.

 

Any ideas, please?  TIA

This topic has been closed for replies.

1 reply

Inspiring
June 22, 2020

I'm just thinking out loud here...
You could try selecting one brush group in photoshop manually and then right click the brush group you want to delete. This could generate different scriptlistener code than the one you already have. To check, look for the name of the brush group in the scriptlistener code. Hope it helps. 🙂