1

I'm creating a very simple GUI in ExtendScript and I'd like to know how to save and open any user inputs from the "edittext" boxes that I've created. How would I be able to add a "file>save" and "file>open" menu to save and retrieve any user inputs?

//GUI Design
var myWin = new Window ("palette", "EditTextTest", undefined);
myWin.orientation = "row";

var groupOne = myWin.add("group", undefined, "GroupOne");
groupOne.orientation = "column";
groupOne.add("statictext", undefined, "Player 01 Name");
var etOne = groupOne.add("edittext", undefined, "");
etOne .characters = 10;
groupOne.add("statictext", undefined, "Player 02 Name");
var etTwo = groupOne.add("edittext", undefined, "");
etTwo .characters = 10;
groupOne.add("statictext", undefined, "Player 03 Name");
var etThree = groupOne.add("edittext", undefined, "");
etThree .characters = 10;
groupOne.add("statictext", undefined, "Player 04 Name");
var etFour = groupOne.add("edittext", undefined, "");
etFour .characters = 10;
groupOne.add("statictext", undefined, "Player 05 Name");
var etFive = groupOne.add("edittext", undefined, "");
etFive .characters = 10;

myWin.center();
myWin.show();
4

1 回答 1

2

如果您正在为 AE 开发,您可以使用以下内容在应用程序的本机首选项文件中存储和检索值:

app.settings.haveSetting("myScriptPrefCategory", "myControl");     //Check for saved pref value
app.settings.saveSetting("myScriptPrefCategory", "myControl", "controlValue");     //Saves a pref value
app.settings.getSetting("myScriptPrefCategory", "myControl");     //Retrieves a pref value

我从大卫·托尔诺那里学到了这一点。 请参阅 AE 脚本论坛上的此论坛主题

初始化代码后,您可以查找已创建的首选项,然后设置您的 UI 以反映存储在该首选项文件中的值。

于 2013-09-16T19:12:24.330 回答