Skip to main content
Aprking
Inspiring
December 6, 2023
Answered

Can Illustrator scripts get whether the preference "use preview bounds" is checked or not?

  • December 6, 2023
  • 1 reply
  • 659 views

I am trying to write a script but am unable to find a method to access preference settings. Does anyone know if Illustrator scripts have the ability to determine if the "use preview bounds" preference is checked or not?

 

If there is no direct method to retrieve it, are there any other ways to determine the state of the preference?

Even if there is no direct way to access the preference value through the scripting objects or methods, I'm wondering if there are any alternative approaches that could be used to programmatically check the state of the "use preview bounds" preference.

 

This topic has been closed for replies.
Correct answer Sergey Osokin

 

alert( app.preferences.getBooleanPreference("includeStrokeInBounds") );

You can also set a Boolean value:

app.preferences.setBooleanPreference('includeStrokeInBounds', true); // or false

 

1 reply

Sergey Osokin
Sergey OsokinCorrect answer
Inspiring
December 6, 2023

 

alert( app.preferences.getBooleanPreference("includeStrokeInBounds") );

You can also set a Boolean value:

app.preferences.setBooleanPreference('includeStrokeInBounds', true); // or false

 

Aprking
AprkingAuthor
Inspiring
December 7, 2023

Test successful! Thank you very much, my friend. Here we are again. Your response has been very helpful to me. I want to know where I can get this kind of information.

Sergey Osokin
Inspiring
December 7, 2023

Unfortunately, you won't find any official documentation. The scripting community finds Preferences keys in files such as AIPreferenceKeys.h (Illustrator SDK) and Adobe Illustrator Prefs.

 

Thanks to @sttk3 , there is now a database of Illustrator App Prefs keys available in Notion: Illustrator Preferences > app.getIntegerPreference | Notion