Photoshop preferences

Community Beginner ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Is there a way or script to change items in photoshop preferences.

TOPICS
Actions and scripting

Views

156

Likes

Translate

Translate

Report

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 2 Correct answers

Community Expert , Aug 24, 2022 Aug 24, 2022

I tested the code on windows 7 CC2020 + camera raw 13, windows 11 CC2022 + camera raw 14 and on MacOs BigSur CC2022 + camera raw 14. I didn't notice any problems anywhere. Did you change the filename? Try this way:

var myFile = (new File()).openDlg();
(d = new ActionDescriptor()).putPath(stringIDToTypeID('null'), myFile);
d.putBoolean(stringIDToTypeID('overrideOpen'), true);
var d1 = new ActionDescriptor();
d.putObject(stringIDToTypeID( 'as' ), stringIDToTypeID( 'Adobe Camera Raw' ), d1 );  
exe
...

Likes

Translate

Translate
Community Expert , Aug 25, 2022 Aug 25, 2022

see Improve image quality using Camera Raw 

According to the description of this function, the result is stored only in DNG. That is, after applying the function, you need to re-open the file with the same name, but with a DNG extension, and save it as a JPG. Something like that:

var myFile = (new File()).openDlg();

try {
    (d = new ActionDescriptor()).putPath(stringIDToTypeID('null'), myFile);
    d.putBoolean(stringIDToTypeID('overrideOpen'), true);
    var d1 = new ActionDescriptor();
    
...

Likes

Translate

Translate
Community Beginner ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Here so I am more precise

what i want to do and enable this item in the photoshop preferences menu
enable the item to open jpg files directly in camera raw.

 

Schermata 2022-08-24 alle 14.54.56.pngSchermata 2022-08-24 alle 14.55.27.pngSchermata 2022-08-24 alle 14.55.47.png

 

Likes

Translate

Translate

Report

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
Community Expert ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Ah, now that you show Camera Raw Preferences, that is one that can't be recorded... So if it is possible, it would take a user with advanced knowledge of writing Action Manager code. Sorry, I can't help with that, but others such as @r-bin and @jazz-y might be able to help...

Likes

Translate

Translate

Report

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
Community Expert ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Yes, many, but not all...

 

For some of the prefs, there is standard DOM code. For example, one of the most common is ruler units:

 

https://theiviaxx.github.io/photoshop-docs/Photoshop/Preferences.html

 

app.preferences.rulerUnits = Units.PIXELS;

 

 

For others not found in the standard DOM, advanced users write Action Manager code, the rest of us record AM code via the Scripting Listener plugin (if available for recording, not all are):

 

https://helpx.adobe.com/au/photoshop/kb/downloadable-plugins-and-content.html#ScriptingListenerplugi...

 

skipTransformWhenPlacing(false);

function skipTransformWhenPlacing(theBool) {
var idset = stringIDToTypeID( "set" );
    var desc2 = new ActionDescriptor();
    var idnull = stringIDToTypeID( "null" );
        var ref1 = new ActionReference();
        var idproperty = stringIDToTypeID( "property" );
        var idgeneralPreferences = stringIDToTypeID( "generalPreferences" );
        ref1.putProperty( idproperty, idgeneralPreferences );
        var idapplication = stringIDToTypeID( "application" );
        var idordinal = stringIDToTypeID( "ordinal" );
        var idtargetEnum = stringIDToTypeID( "targetEnum" );
        ref1.putEnumerated( idapplication, idordinal, idtargetEnum );
    desc2.putReference( idnull, ref1 );
    var idto = stringIDToTypeID( "to" );
        var desc3 = new ActionDescriptor();
        var idextensionsOn = stringIDToTypeID( "extensionsOn" );
        desc3.putBoolean( idextensionsOn, false );
        var idskipTransformSOFromLibrary = stringIDToTypeID( "skipTransformSOFromLibrary" );
        desc3.putBoolean( idskipTransformSOFromLibrary, theBool );
    var idgeneralPreferences = stringIDToTypeID( "generalPreferences" );
    desc2.putObject( idto, idgeneralPreferences, desc3 );
executeAction( idset, desc2, DialogModes.NO );
}

 

 

Likes

Translate

Translate

Report

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
Community Beginner ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

i downloaded scripenlistenerplugin but it didn't log anything

you have a solution to enable that voice

 

Likes

Translate

Translate

Report

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
Community Expert ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Sadly that is so, not everything can be recorded into an Action or recorded as AM code from the SL plugin. It may be possible with advanced AM coding knowledge.

Likes

Translate

Translate

Report

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
Community Expert ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

At any time, you can open a supported file using camera Raw with:

 

var myFile = new File( '/e/myTestJPG.jpg');
(d = new ActionDescriptor()).putPath(stringIDToTypeID('null'), myFile);
d.putBoolean(stringIDToTypeID('overrideOpen'), true);
var d1 = new ActionDescriptor();
d.putObject(stringIDToTypeID( 'as' ), stringIDToTypeID( 'Adobe Camera Raw' ), d1 );  
executeAction(stringIDToTypeID('open'), d, DialogModes.ALL);

 

Likes

Translate

Translate

Report

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
Community Beginner ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

@jazz-y
I tried the script but it opens the photo in photoshop and not in camera raw?

 

Likes

Translate

Translate

Report

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
Community Expert ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

I tested the code on windows 7 CC2020 + camera raw 13, windows 11 CC2022 + camera raw 14 and on MacOs BigSur CC2022 + camera raw 14. I didn't notice any problems anywhere. Did you change the filename? Try this way:

var myFile = (new File()).openDlg();
(d = new ActionDescriptor()).putPath(stringIDToTypeID('null'), myFile);
d.putBoolean(stringIDToTypeID('overrideOpen'), true);
var d1 = new ActionDescriptor();
d.putObject(stringIDToTypeID( 'as' ), stringIDToTypeID( 'Adobe Camera Raw' ), d1 );  
executeAction(stringIDToTypeID('open'), d, DialogModes.ALL);

Do you have a CameraRaw filter in your filter menu?

Likes

Translate

Translate

Report

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
Community Beginner ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

@ jazz-y
Now it works perfectly
thanks you are a great teacher.

 

Likes

Translate

Translate

Report

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
Community Beginner ,
Aug 25, 2022 Aug 25, 2022

Copy link to clipboard

Copied

@ jazzy-y The script works fine, but I would like if changes were possible When I open the photo in camera raw and apply super resolution it saves me the photo in dng. This is not good for me I would like you to save me the jpg at the highest quality and not the dng. I hope you can help me

Likes

Translate

Translate

Report

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
Community Expert ,
Aug 25, 2022 Aug 25, 2022

Copy link to clipboard

Copied

see Improve image quality using Camera Raw 

According to the description of this function, the result is stored only in DNG. That is, after applying the function, you need to re-open the file with the same name, but with a DNG extension, and save it as a JPG. Something like that:

var myFile = (new File()).openDlg();

try {
    (d = new ActionDescriptor()).putPath(stringIDToTypeID('null'), myFile);
    d.putBoolean(stringIDToTypeID('overrideOpen'), true);
    var d1 = new ActionDescriptor();
    d.putObject(stringIDToTypeID('as'), stringIDToTypeID('Adobe Camera Raw'), d1);
    executeAction(stringIDToTypeID('open'), d, DialogModes.ALL);
} catch (e) { }

var dngName = new RegExp(encodeURI(decodeURI(myFile.name).replace(/\.[0-9a-z]+$/, '')) + '.+?\.dng', 'i'),
    dngFile = (Folder(myFile.path)).getFiles(dngName);

if (dngFile.length) {
    app.open(dngFile[0])
    activeDocument.saveAs(File(dngFile[0]), function () { var o = new JPEGSaveOptions; o.quality = 12; return o }())
    activeDocument.close()
    dngFile[0].remove()
}

 

Likes

Translate

Translate

Report

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
Community Beginner ,
Aug 25, 2022 Aug 25, 2022

Copy link to clipboard

Copied

LATEST

It works like magic

thanks for your great help

 

Likes

Translate

Translate

Report

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