03-04-2023, 12:03 PM
(This post was last modified: 03-04-2023, 12:04 PM by Rick Johnson.)
I'd been meaning to test this with the SDK, but hadn't gotten around to it. Then fellow CORE user Tom Raisk wrote and said that he had done some tests, and said: "Turns out if you want to obtain a pref value without preliminary check for existence Adobe Illustrator creates this pref value. AI 2022 makes it with "0" value, AI 2023 - with some random number.
But sAIPref->PreferenceExists works nominally. At least this code below (both for AI 2022 and 2023) does:
It correctly determines that "somePref" does not exist.
Unfortunately, the PreferenceExists function has no counterpart in CORE.
But sAIPref->PreferenceExists works nominally. At least this code below (both for AI 2022 and 2023) does:
Code:
AIBoolean isAppPrefExists;
error = sAIPref->PreferenceExists(NULL, "somePref", &isAppPrefExists);
if (isAppPrefExists)
{
int prefIntValue;
error = sAIPref->GetIntegerPreference(NULL, "somePref", &prefIntValue);
hdi::core::alerts::message("App Pref value is: " + to_string(prefIntValue));
}
It correctly determines that "somePref" does not exist.
Unfortunately, the PreferenceExists function has no counterpart in CORE.