SamIWas Posted February 9, 2022 Share Posted February 9, 2022 (edited) So, say I have a script with a dialog where the user can input several values. in this case, let's say it's a pull-down menu. What is the method used so that the next time the script is run, the last-chosen or last-inputted value is populated in the dialog? I'm assuming it has something to do with string definitions or something, but I haven't delved into this yet. Or maybe it's in the parameters? Example: Script is run, and the dialog has an edit box named "Start" where the user enters "100" as the value. The next time the script runs, I want "100" to be in that edit box. Or if they choose "Channel" from a drop down, then "Channel" would be the chosen option next time. Edited February 9, 2022 by SamIWas Quote Link to comment
JBenghiat Posted February 9, 2022 Share Posted February 9, 2022 Set/GetSavedSetting If the user clicks OK, set the saved setting. On dialog setup, check if the saved setting exists, and if so, set the value to the saved setting. Quote Link to comment
Pat Stanford Posted February 9, 2022 Share Posted February 9, 2022 Or if you have more things you want to save, you can write/read your own txt or XML file. The SavedSettings doc say these are for Convenience functions not critical functions. So writing your own file and making sure it is written might be a better option. But SavedSettings are much easier. Quote Link to comment
SamIWas Posted February 9, 2022 Author Share Posted February 9, 2022 Thanks guys! I will look into this tomorrow. Seems easy enough.......... Quote Link to comment
Hippocode Posted February 9, 2022 Share Posted February 9, 2022 Set/GetSavedSetting is by far the easiest option to use, but this is more commonly used for settings that surpass the scope of a drawing/document. If you need to remember these settings based on the active file you can also use a custom hidden record with a field for each setting you require. Quote Link to comment
Peter Vandewalle Posted February 10, 2022 Share Posted February 10, 2022 If the script is a menu command, you could also use the menu command parameters... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.