Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script to change art history brush preset?

Participant ,
Nov 01, 2025 Nov 01, 2025

Hello,
can anyone help me with a script that changes the style of the art history brush (e.g: dab, tight short....)?

TOPICS
Actions and scripting , macOS , Windows
48
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Nov 03, 2025 Nov 03, 2025

I figured it out:

function setArtHistoryBrushStyle(style) {
        if (style === undefined) style = 6;
        var ref = new ActionReference();
        ref.putProperty(stringIDToTypeID("property"), stringIDToTypeID("currentToolOptions"));
        ref.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
        var fullDesc = executeActionGet(ref);
        var cto = fullDesc.getObjectValue(stringIDToTypeID("currentToolOptions"));
        cto
...
Translate
Adobe
Participant ,
Nov 03, 2025 Nov 03, 2025
LATEST

I figured it out:

function setArtHistoryBrushStyle(style) {
        if (style === undefined) style = 6;
        var ref = new ActionReference();
        ref.putProperty(stringIDToTypeID("property"), stringIDToTypeID("currentToolOptions"));
        ref.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
        var fullDesc = executeActionGet(ref);
        var cto = fullDesc.getObjectValue(stringIDToTypeID("currentToolOptions"));
        cto.putInteger(charIDToTypeID("AHBs"), style);
        var desc = new ActionDescriptor();
        var refTarget = new ActionReference();
        refTarget.putClass(stringIDToTypeID("artBrushTool"));
        desc.putReference(stringIDToTypeID("target"), refTarget);
        desc.putObject(stringIDToTypeID("to"), stringIDToTypeID("currentToolOptions"), cto);
        executeAction(stringIDToTypeID("set"), desc, DialogModes.NO);
        return true;
}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines