Copy link to clipboard
Copied
Hi all,
I'm trying to imitate the following preferences in Illustrator, disabling them all by using Javascript...
The following worked a treat, and do exactly what's being asked:
app.preferences.setBooleanPreference('CrashRecovery/AutomaticallySave', false);
app.preferences.setBooleanPreference('CrashRecovery/TurnOffForComplexDocument', false);
However, the following don't seem to work at all, where am I going wrong?
app.preferences.setBooleanPreference('enableBackgroundSave', false);
app.preferences.setBooleanPreference('enableBackgroundExport', false);
app.preferences.setBooleanPreference('cloudAIEnableAutoSave', false);
Any help would be much appreciated!
Cheers,
Sam
Copy link to clipboard
Copied
I have also tried this. However, all it did was add more custom items to the preferences file. In other words, your code is correct, but Illustrator is not supposed to handle that key.
Perhaps you could change it by directly rewriting the "Adobe Illustrator Cloud Prefs" file.
Copy link to clipboard
Copied
Thanks for testing @sttk3! It's interesting that it's adding additional items to the preferences file, are these different to what's being referenced above? If I can, I want to try and resolve this issues without manipulating the prefs file itself... I take it the prefs file is ingested when Illustrator loads and isn't referenced again until it's restarted, is this correct? The goal is to manage everything whilst Illustrator is loaded, if this is possible, but if not, I'll have to workaround the above issue altogether.
Copy link to clipboard
Copied
Looking deeper into the pref files @sttk3, something seems to be going wrong when setting the preferences using Javascript... There are 2 preferences files which Illustrator references when it loads:
• Adobe Illustrator Prefs
• Adobe Illustrator Cloud Prefs
The 'CrashRecovery/AutomaticallySave' and 'CrashRecovery/TurnOffForComplexDocument' preferences both exist in the Adobe Illustrator Prefs file, and when the above Javascript is run, this information is updated in the same file.
However...
The 'enableBackgroundSave', 'enableBackgroundExport' and 'cloudAIEnableAutoSave' preferences only exist in the Adobe Illustrator Cloud Prefs file, and when using the above Javascript, it actually writes new statements to the Adobe Illustrator Prefs file, instead of updating the Illustrator Cloud Prefs file. Yet, when there are specific preferences that only exist in the Illustrator Cloud Prefs file i.e. 'scaleLineWeight', manipulating this using Javascript keeps it in the same file.
Copy link to clipboard
Copied
> are these different to what's being referenced above?
It is different; Illustrator is judging that key is an item that the user has defined for their own use.
> I take it the prefs file is ingested when Illustrator loads and isn't referenced again until it's restarted, is this correct?
Yes, that is correct. Which is a problem. It may be possible to change it without restarting by using AppleScript, AutoHotkey, etc., opening a preferences window and manipulating the corresponding checkbox with keystrokes.