Skip to main content
PECourtejoie
Community Expert
Community Expert
September 22, 2022
Open for Voting

Reset preferences should back them up, include sys info.

  • September 22, 2022
  • 18 replies
  • 1494 views

Many times, there is a suggestion in the forum to have a user reset the preferences, as it is known to cure many issues. Unfortunately, it sometimes does not work, and the user has to recreate them manually.

In addition, the preferences file, once deleted, is not available for troubleshooting by the Ps team.

 

(in the forum, I now suggest the manual method of copying the folder to the desktop to keep a copy.

https://helpx.adobe.com/photoshop/using/preferences.html#Manually

thanks to a post by @J453 )

 

I think that it would be beneficial to every user if the reset preferences function, either by shortcut, or via the preferences, would instead zip the existing preferences folder (or maybe just suffix it with "old" (or the beloved "legacy" term used all over the app.) In addition, it could also include the system information text.

 

This way, it would be possible to troubleshoot preferences and have system information in one go, and the user would be able to revert them easily.

 

Another idea would be to create a backup at startup, to get a last known working preferences file and a way to revert them, like we can use a backup firmware in some cameras.

 

EDIT Thanks to @Stephen Marsh he has coded a script, that, IMHO, should be integrated in the application itself!

18 replies

Stephen Marsh
Community Expert
Community Expert
September 27, 2022
quote

@Stephen_A_Marsh Stunning!

I am always in awe in front of scripters' work.

Now the Ps team just needs to use your code to replace theirs in the application!


By @PECourtejoie

 

@PECourtejoie – thank you for the kind words. At least half of the script credit goes to @r-bin – it would have taken me a lot longer and it would have been far more work to implement a recursive file/folder copy function on my own. So thanks to you for the idea and to r-bin. This is what the community is about.

PECourtejoie
Community Expert
Community Expert
September 27, 2022

@Stephen Marsh Stunning!

I am always in awe in front of scripters' work.

Now the Ps team just needs to use your code to replace theirs in the application!

jane-e
Community Expert
Community Expert
September 26, 2022

 

@Gixxxa75 wrote: Or just being able to save the workspace layout seperate from the preferances would be a major improvement.

 

Resetting preferences does not remove saved workspaces. They are already separate. Or maybe I misunderstand what you are saying?

 

Jane

 

Gixxxa75
Inspiring
September 26, 2022

I like the way the Wacom desktop center works, you can back up your tablet preferances, either saving them on the wacom server via your account or locally to your PC. Could they do something similar with creative cloud app? Or just being able to save the workspace layout seperate from the preferances would be a major improvement. Everythings not quite in the right place after a reset!

Stephen Marsh
Community Expert
Community Expert
September 25, 2022

@PECourtejoie 

 

Until Adobe potentially implements your ideas... Here they are in a script.

 

The system info will be written to a text file on the desktop titled "Adobe Photoshop #### System Info.txt", (with #### being the version number).

 

The settings/prefs files will be copied to a new folder on the desktop titled "Adobe Photoshop #### Settings", (with #### being the version number).

 

/*
Backup Photoshop Settings and System Info.jsx
v1.0, Stephen Marsh - 25th September 2022
With inspiration from:
https://community.adobe.com/t5/photoshop-ecosystem-ideas/reset-preferences-should-back-them-up-include-sys-info/idi-p/13216667
https://helpx.adobe.com/photoshop/using/preferences.html#Manually
https://github.com/MarshySwamp/Backup-Photoshop-Settings-Universal

The system info will be written to a text file on the desktop titled "Adobe Photoshop #### System Info.txt", (with #### being the version number).
The settings/prefs files will be copied to a new folder on the desktop titled "Adobe Photoshop #### Settings", (with #### being the version number).
*/

#target photoshop

try {

    var os = $.os.toLowerCase().indexOf("mac") >= 0 ? "mac" : "windows";
    if (os === "mac") {
        sysInfoLF = "Unix";
    } else {
        sysInfoLF = "Windows";
    }

    var appPath = app.path.fsName.replace(/^\/.+\//, '');
    var sysInfo = new File("~/Desktop/" + appPath + " System Info.txt");
    sysInfo.open('w');
    sysInfo.encoding = 'UTF-8';
    sysInfo.lineFeed = sysInfoLF;
    sysInfo.write(app.systemInformation);
    sysInfo.close();

    if (os === "mac") {
        // alert("It's a Mac!");
        var userSettingsDir = '~/Library/Preferences/' + appPath + ' Settings';
        var userSettingsDirOpen = Folder(userSettingsDir);
        //userSettingsDirOpen.execute();

    } else {
        // alert("It's Windows!");
        var userSettingsDir = '~/appData/Roaming/Adobe/' + appPath + '/' + appPath + ' Settings';
        var userSettingsDirOpen = Folder(userSettingsDir);
        //userSettingsDirOpen.execute();
    }

    var backupDir = new Folder("~/Desktop/" + appPath + ' Settings');
    if (!backupDir.exists) backupDir.create();

    /*
    Folder and file copy by r-bin
    https://community.adobe.com/t5/photoshop-ecosystem-discussions/a-script-to-clone-copy-a-folder-that-contains-multi-folders-and-files-to-another-folder/m-p/12121520
    */
    var ret = copy_folder(userSettingsDir, backupDir);

    function copy_folder(src_path, dst_path) {
        try {
            var f = (new Folder(src_path)).getFiles();

            for (var i = 0; i < f.length; i++)
                if (!copy_file(f[i], dst_path)) return false;

            return true;
        } catch (e) {
            alert(e);
        }
    }

    function copy_file(full_path, new_path) {
        try {
            var file = new File(full_path);

            var folder = new File(new_path);

            if (file.length < 0) {
                if (!create_path(new_path + "/" + file.name)) return false;
                if (!copy_folder(full_path, new_path + "/" + file.name)) return false;

                return true;
            } else {
                if (!create_path(new_path)) return false;
                if (!file.copy(new_path + "/" + file.name)) return false;

                return true;
            }

            function create_path(path) {
                var folder = new Folder(path);

                if (!folder.exists) {
                    var f = new Folder(folder.path);
                    if (!f.exists)
                        if (!create_path(folder.path)) return false;

                    if (!folder.create()) return false;
                }

                return true;
            }
        } catch (e) {
            throw (e);
        }
    }

    alert("A backup copy of your Photoshop Settings folder and System Info has been created on the desktop.");

} catch (e) {
    alert(e);
}

 

The script can be automated from the Script Events Manager:

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

 

Info on saving and using this script:

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

jane-e
Community Expert
Community Expert
September 24, 2022

Voted

davescm
Community Expert
Community Expert
September 23, 2022

Excellent suggestion Pierre - I've voted

 

Dave

Stephen Marsh
Community Expert
Community Expert
September 23, 2022

@PECourtejoie – All good ideas!