This Save method saves the value of an individual preference to the ENVI preferences file. It saves only the individual value of the preference and not other preferences that have been modified in the API.


; Launch ENVI
e = ENVI()
; Update the Overview's border color to cyan and save it.
prefItem = e.Preferences['overview:border color']


ENVIPreferenceItem.Save [, Keywords=value]





Set this keyword to the name of a JSON file where preferences will be saved. If this keyword is not specified, preferences will be saved to the JSON file specified by the ENVIPreferences object URI property.

If preferences are saved in a location other than the default JSON file, they will not be loaded when ENVI is launched in future sessions. To load preferences from a location other than the default, call ENVIPreferences::Load with the specified URI. To override the default preferences file throughout the ENVI application (including where preferences are automatically saved) specify the PREFERENCES keyword of ENVI function when launching ENVI.


Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

Version History

ENVI 5.2


API Version


See Also

ENVI, ENVIPreferenceItem, ENVIPreferences, ENVIPreferences::Load, ENVIPreferences::Save