Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
2

Using Javascript to manage the File Save Options

Explorer ,
Oct 17, 2023 Oct 17, 2023

Hi all,

 

I'm trying to imitate the following preferences in Illustrator, disabling them all by using Javascript...

Screenshot 2023-10-17 at 15.46.13.pngexpand image

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

TOPICS
Scripting
345
Translate
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 ,
Oct 17, 2023 Oct 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.

Translate
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
Explorer ,
Oct 18, 2023 Oct 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.

Translate
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
Explorer ,
Oct 18, 2023 Oct 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.

Translate
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 ,
Oct 18, 2023 Oct 18, 2023
LATEST

> 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.

Translate
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