Storing preferences in a variableIn a script, I would like to:
1. Store current preferences in a variable to be able to later restore them
2. Modify some preferences
... do some stuff in the script, like importing an Excel file that requires specific preferences set to work ...
3. Restore the original preferences
Is there any way to do the above in JMP? I know how to modify preferences, but I cannot find a way to store current preferences to be able to restore them.
Data AccessRe: Storing preferences in a variableIf this is in a script/tool that someone else besides you might be using, I would strongly suggest saving them into a file which won't be accidentally overwritten.
I have seen quite a few scripts/tools which modify users preferences with the idea of returning them. But if there is an error and there is no proper error handling... if you re-run the script, your preferences are basically gone as the variable will be overwritten with the modified preferences.
Re: Storing preferences in a variableThanks for your swift reply. Had actually just realized it myself and rushed to delete the post, but too late
What confused me was that the variable returned an empty value, but using show(x), I could see that the variable contained a script that returns the empty value I was viewing. Maybe it will help somebody else getting confused about this in the future!
Re: Storing preferences in a variableHi @thomasz,
There is a Preferences Manager (with import/export) add-in that performs these tasks already.
Have a look and try it out to see if it will meet your needs.
cheers,
Stan
Re: Storing preferences in a variableIf you add an assignment to the Get Prferences() function, it will assign the preference expression to the variable
Names Default To Here( 1 );
x=Get Preferences( );
Examples of retrieving and saving preferences are found in the Scripting Index.
You can either manipulate the expression or convert it to a character string and manipulate it using the string functions. Then as you apply it, you just convert it back to an expression and then apply it.