Skip to main content
Inspiring
August 31, 2016
Question

Brush Panel Transfer Mode Toggle

  • August 31, 2016
  • 2 replies
  • 2222 views

Is there a way to toggle the Brush Panel Transfer mode check box with a script?

If this toggle can be scripted then a mac osx function key can be assigned to toggle the state of the Transfer check box.

I have created a Tool Preset with the Brush Panel Transfer ON and OFF.

This topic has been closed for replies.

2 replies

SuperMerlin
Inspiring
September 11, 2016

The problem you will have is that the presets will only be of use to one brush.

This will toggle between to presets.

#target photoshop;

var PT = $.getenv("PanelTransfer");

if(PT == null || PT == "OFF"){

    $.setenv("PanelTransfer","ON");

    selectBrushPreset("Brush Panel Transfer ON"); //Name of brush preset

    }else{

     $.setenv("PanelTransfer","OFF");

    selectBrushPreset("Brush Panel Transfer OFF"); //Name of brush preset

        }

function selectBrushPreset(preset) {

var desc = new ActionDescriptor();

var ref = new ActionReference();

ref.putName( charIDToTypeID('Brsh'), preset );

desc.putReference( charIDToTypeID('null'), ref );

executeAction( charIDToTypeID('slct'), desc, DialogModes.NO );

};

JJMack
Community Expert
Community Expert
September 11, 2016

Yes presets are very specific.  Scripting brush attributes is difficult because what can be scripted changes with brush tip types and brush types. What can be scripted for round tip brushes is not valid the sampled brush tips and special brush have different attributes. So what can be directly scripted  depends on the current brush.

JJMack
JJMack
Community Expert
Community Expert
August 31, 2016

A script can  be triggered with a shortcut  using edit keyboard shortcuts. Actions can be assigned a f key short cut and that actions can use  scripts.  So yes a script can  run  with a key.  A script can be programmed  to toggle between selecting presets on and off.

JJMack
Inspiring
August 31, 2016

Can you point me to a sample  script that toggles a tool/preset on/off?

JJMack
Community Expert
Community Expert
August 31, 2016

I would need to search and find one or write one but that is for you to do.

JJMack