Skip to main content
Inspiring
October 17, 2023
Question

Using Javascript to manage the File Save Options

  • October 17, 2023
  • 1 reply
  • 569 views

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

This topic has been closed for replies.

1 reply

Legend
October 17, 2023

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.

Inspiring
October 18, 2023

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.

Inspiring
October 18, 2023

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.