Skip to main content
SheriffTech
Participant
August 17, 2022
Answered

reload color settings after a photoshop cleaning

  • August 17, 2022
  • 2 replies
  • 500 views

Hello everyone how are you ?

I am working, at a studio photo, there is a post for clients with photoshop, between shootings i run a bash script who delete all the data of photoshop 

rm -r /Users/$USER/Library/Preferences/Adobe\ Photoshop*
rm -rf /Users/$USER/Library/Preferences/Adobe\ Photoshop*
rm -rf /Users/$USER/Library/Preferences/com.adobe.Photoshop*

 

I got a struggle I need to setup with script bash or something else, a solution when I should clean all Photoshop setting without touching the color settings, but I can't find the life which is link with thoses settings. Could someone can help me please ? 

I think about another way to do this, maybe a script after I ran my cleanup, which load the good CSF file with my settings. It need to be automatically because the client clean the laptop at the end of the shoot and they always forgot the color settings.

 

Sorry for my english 

Best regards,

 

 

This topic has been closed for replies.
Correct answer Stephen Marsh

@SheriffTech – I think that @Kevin Stohlmeyer has a good suggestion.

 

If you wish to stick with your bash script approach, then a Photoshop JavaScript to load your custom-named color settings file "SHERIFF":

 

loadColorSettings("SHERIFF");

function loadColorSettings(csfName) {
	function s2t(s) {
        return app.stringIDToTypeID(s);
    }
	var descriptor = new ActionDescriptor();
	var descriptor2 = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putProperty( s2t( "property" ), s2t( "colorSettings" ));
	reference.putEnumerated( s2t( "application" ), s2t( "ordinal" ), s2t( "targetEnum" ));
	descriptor.putReference( s2t( "null" ), reference );
	descriptor2.putString( s2t( "name" ), csfName );
	descriptor.putObject( s2t( "to" ), s2t( "colorSettings" ), descriptor2 );
	executeAction( s2t( "set" ), descriptor, DialogModes.NO );
}

 

2 replies

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
August 17, 2022

@SheriffTech – I think that @Kevin Stohlmeyer has a good suggestion.

 

If you wish to stick with your bash script approach, then a Photoshop JavaScript to load your custom-named color settings file "SHERIFF":

 

loadColorSettings("SHERIFF");

function loadColorSettings(csfName) {
	function s2t(s) {
        return app.stringIDToTypeID(s);
    }
	var descriptor = new ActionDescriptor();
	var descriptor2 = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putProperty( s2t( "property" ), s2t( "colorSettings" ));
	reference.putEnumerated( s2t( "application" ), s2t( "ordinal" ), s2t( "targetEnum" ));
	descriptor.putReference( s2t( "null" ), reference );
	descriptor2.putString( s2t( "name" ), csfName );
	descriptor.putObject( s2t( "to" ), s2t( "colorSettings" ), descriptor2 );
	executeAction( s2t( "set" ), descriptor, DialogModes.NO );
}

 

SheriffTech
Participant
August 17, 2022

thank you i will check how can I run this linked with bash script !

Stephen Marsh
Community Expert
Community Expert
August 17, 2022

You're welcome. I'm not sure if this helps or not for automation:

 

https://prepression.blogspot.com/2021/10/photoshop-script-events-manager.html

 

Kevin Stohlmeyer
Community Expert
Community Expert
August 17, 2022

A simpler option is to use the Photoshop Preferences/General and click the Reset Preferences upon Quit.

That resets your PS preferences and maintains the color settings.

SheriffTech
Participant
August 17, 2022

I need it to be automated because i'm not physically here to clic the button for customers. Do you know how can I make a script or something else ?