Skip to main content
Inspiring
December 3, 2023
Answered

How to disable automatically changing text color when I change foreground color in text layer?

  • December 3, 2023
  • 2 replies
  • 1250 views

Hi, I can't English well 😞

 

In the past, even if you changed the color in the text layer, it was not immediately applied to the text.

It was applied to the text color only when I filled it.

 

but now, if I change a foreground color, it automatically applies to the text color.

It's fainful. so I'm looking for turn off option.

 

I cant' find that option, in type tool, preferences/general, type..

Is there any way to turn it off?

This topic has been closed for replies.
Correct answer 지영5E57
function restoreTextColor(){
    var doc = app.activeDocument

    if (doc.activeLayer.kind == LayerKind.TEXT){
        var last = doc.historyStates.length - 1;

        if (doc.historyStates[last].name == "Set Character Style"){
            executeAction(charIDToTypeID('undo'), undefined, DialogModes.NO);
        }
    }
}

//EventHandler: Scripts/Script Events Manager...
try {
    if (arguments.length >= 2){
        var desc = arguments[0];
        var event = arguments[1];
  
        if (event == charIDToTypeID('setd')){
            var ref = desc.getReference(charIDToTypeID('null'));
            var cls = ref.getDesiredClass();
  
            if (cls == charIDToTypeID('Clr ')){
                var property = ref.getProperty();
  
                if(property == charIDToTypeID('FrgC')){
                    restoreTextColor();
                }
            }
        }
    }
}
catch(e){}

2 replies

Inspiring
December 11, 2023

yap, I made script. It works.

 

If you want to fix this problem. try this.

1. Save the script below as a jsx file.

function restoreTextColor(){
    if (app.activeDocument.activeLayer.kind == LayerKind.TEXT){
        executeAction(charIDToTypeID('undo'), undefined, DialogModes.NO);
    }
}

//EventHandler: Scripts/Script Events manager
try {
    if (arguments.length >= 2){
        var desc = arguments[0];
        var event = arguments[1];
  
        if (event == charIDToTypeID('setd')){
            var ref = desc.getReference(charIDToTypeID('null'));
            var cls = ref.getDesiredClass();
  
            if (cls == charIDToTypeID('Clr ')){
                var property = ref.getProperty();
  
                if(property == charIDToTypeID('FrgC')){
                    restoreTextColor();
                }
            }
        }
    }
}
catch(e){}

 2. Open Popup: Photoshop MainMenu/File/Scripts/Script Events Manager 

3. Check: Enable Events to Run Scripts/Actions 

4. Photoshop Event: Everything

5. Script: Browse...

6. Select that script file.

7. Add

 

then if you change foreground color in text layer.

Event handler get event, and undo Set Character Style.

 

c.pfaffenbichler
Community Expert
Community Expert
December 11, 2023

Hmm … 

What happens if you change the Foreground Color not via Swatches Panel but via another methos, like clicking the swatch in the Toolbar? 

Inspiring
December 11, 2023

The event handler code I used is here.

he was explain that the user changes the foregroundColor using the colorPicker or eyedropper.

Inspiring
December 3, 2023

Oh.. It's painful.. not fainful.... haha

c.pfaffenbichler
Community Expert
Community Expert
December 4, 2023

Could you please post screenshots taken at View > 100% with the pertinent Panels (Toolbar, Layers, Character, Options Bar, …) visible? 

Did you actually select the Text or just the Type Layer? 

Inspiring
December 11, 2023

not select Text, just Type Layer