The extendscript function
app.preferences.getPrefAsBool()
always returns false. Here's a demo, comparing it to getPrefAsLong, which seems to work:
app.preferences.getPrefAsLong("Main Pref Section v2", "Pref_SEQUENCE_ZEROS", PREFType.PREF_Type_MACHINE_SPECIFIC)
> 5
// returns 5 which should be truthy, but
app.preferences.getPrefAsBool("Main Pref Section v2", "Pref_SEQUENCE_ZEROS", PREFType.PREF_Type_MACHINE_SPECIFIC)
> false
//returns wrong answer
app.preferences.getPrefAsLong("Main Pref Section v2", "Pref_HIDE_LOCKED_MASKS", PREFType.PREF_Type_MACHINE_SPECIFIC)
> 0
// returns 0, should be falsy
app.preferences.getPrefAsBool("Main Pref Section v2", "Pref_HIDE_LOCKED_MASKS", PREFType.PREF_Type_MACHINE_SPECIFIC)
> false
//returns false, so it's not just inverting the answer
app.preferences.getPrefAsLong("Main Pref Section", "Pref_SCRIPTING_FILE_NETWORK_SECURITY")
> 1
//returns 1. Note, using "Main Pref Section" and no PREFTYPE enum
app.preferences.getPrefAsBool("Main Pref Section", "Pref_SCRIPTING_FILE_NETWORK_SECURITY")
> After Effects error: The section name and key (Main Pref Section, Pref_SCRIPTING_FILE_NETWORK_SECURITY) could not be found in the preferences.
// throws an error
app.preferences.getPrefAsBool("Main Pref Section", "Pref_SCRIPTING_FILE_NETWORK_SECURITY", PREFType.PREF_Type_MACHINE_SPECIFIC)
> After Effects error: The section name and key (Main Pref Section, Pref_SCRIPTING_FILE_NETWORK_SECURITY) could not be found in the preferences.
// tried with the preftype specified, still not found
app.preferences.getPrefAsBool("Main Pref Section v2", "Pref_SCRIPTING_FILE_NETWORK_SECURITY", PREFType.PREF_Type_MACHINE_SPECIFIC)
> false
// returns false, so it found the pref, but reported it wrong.