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

CS5: settings.getSetting()

New Here ,
Jan 26, 2011 Jan 26, 2011

Copy link to clipboard

Copied

I can't seem to get the getSetting method of "Settings" to work.  I found the "Section Name" and "Key" in the prefs file, but AE does not recognize the names.  It doesn't recognize the example command in the CS3 scripting guide, either.

I am just trying to check if the user has the "Allow Scripts to Write Files and Access Network" box ticked.

Thanks for any help.

TOPICS
Scripting

Views

896

Translate

Translate

Report

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

correct answers 1 Correct answer

Enthusiast , Jan 26, 2011 Jan 26, 2011

Here's an example for accessing a script generated pref:

if (app.settings.haveSetting("myPrefSection", "myPrefName")) {

     var theResult = app.settings.getSetting("myPrefSection", "myPrefName"));

}

But that won't work for regular non script generated prefs like the security setting, and I don't think the necessary methods for that are documented.

Here's an example of a function for checking the security setting:

function isSecurityPrefSet(){

     var securitySetting = app.preferences.getPrefAsLon

...

Votes

Translate

Translate
Enthusiast ,
Jan 26, 2011 Jan 26, 2011

Copy link to clipboard

Copied

Here's an example for accessing a script generated pref:

if (app.settings.haveSetting("myPrefSection", "myPrefName")) {

     var theResult = app.settings.getSetting("myPrefSection", "myPrefName"));

}

But that won't work for regular non script generated prefs like the security setting, and I don't think the necessary methods for that are documented.

Here's an example of a function for checking the security setting:

function isSecurityPrefSet(){

     var securitySetting = app.preferences.getPrefAsLong("Main Pref Section", "Pref_SCRIPTING_FILE_NETWORK_SECURITY");

     return (securitySetting == 1);

}

Votes

Translate

Translate

Report

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
New Here ,
Jan 26, 2011 Jan 26, 2011

Copy link to clipboard

Copied

LATEST

Nice.  Thanks for the quick answer.

Votes

Translate

Translate

Report

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