Text file to dockable panel

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

Ok this is probably really ambitious for my lean knowledge, but I am trying to get the contents of a local txt file read from it's path location and placed into a dockable palette window in AE CS3. I have tried various piecing together of scripts to try and get something to work, but have only figured out one method to make it work, but it is not dockable and it involves lots of copy & paste and doesn't involve reading the actual txt file. This defeats the purpose of the script.

This seemed close, but again I need to load the contents into a window/panel.
<http://www.aenhancers.com/viewtopic.php?t=90>


The only script I have so far is this, but it is the manual version that I don't like plus the "Sections" in the file are titled so the window doesn't need to be divided up like the script shows. Any help appreciated. Thanks.

Code: Select all

var dlg = new Window('palette', 'Info Reference');
// Section 1
dlg.msgPnl = dlg.add('panel', undefined, 'Section 1'); 
dlg.msgPnl.St = dlg.msgPnl.add('statictext', undefined, 'Line 1'); 
dlg.msgPnl.St = dlg.msgPnl.add('statictext', undefined, 'Line 2');
dlg.msgPnl.St = dlg.msgPnl.add('statictext', undefined, 'Line 3');
dlg.msgPnl.St = dlg.msgPnl.add('statictext', undefined, 'Line 4');

// Section 2
dlg.msgPnl = dlg.add('panel', undefined, 'Section 2'); 
dlg.msgPnl.St = dlg.msgPnl.add('statictext', undefined, 'Line 1'); 
dlg.msgPnl.St = dlg.msgPnl.add('statictext', undefined, 'Line 2');
dlg.msgPnl.St = dlg.msgPnl.add('statictext', undefined, 'Line 3');
dlg.msgPnl.St = dlg.msgPnl.add('statictext', undefined, 'Line 4');

dlg.show();
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

Ok, so I've been researching, learning and piecing together and learning and failing and learning... :) I've put this together with help from other scripts and concepts. Still doesn't work, but maybe someone can help me push this along further. This is the code so far...

Code: Select all

// aeKeysSetup Object
	function aeKeysSetup(thisObj)
	{
		var aeKeysData = new Object();
		aeKeysData.scriptName = "Shortcut Keys";
		aeKeysData.version = "0.3";
		aeKeysData.strHelp = "?";
		aeKeysData.strAbout = "Key Reference\n" +
		"\n" +
		"Created by, David Torno March, 2008\n" +
		"Additional resource's, help and inspiration...\n" +
		"-Redefinery - Lloyd Alvarez\n" +
		"-aescripts.com\n" +
		"-aenhancers.com\n" +
		"-Dan Ebberts and motionscript.com\n" +
		"-The world Wide Web and various books help make my brain\n" +
		" understand this Javascript thingy\n" ;
	}
	// Build the interface	
	function aeKeysSetup_buildUI(thisObj)
	{
		var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", aeKeysData.scriptName, myFile, {resizeable:true});
			if (pal != null)
			{
			
			// Open file and read contents (hopefully).
			var myFile = fileGetDialog("Find the file","");
			if (myFile !=null){
	
			// open file
			var fileOk = myFile.open("r", "TEXT", "????");
			if (fileOk){
	
			var text;
			while (!myFile.eof){
			text = myFile.readIn();
			if (text == "") text = "/r" ;
			
			// close file before exiting
			myFile.close();
			}
			
				var res =
				"group { \
						orientation:'column', alignment:['left', 'fill'], spacing:5, margins:[0,0,0,0], \
				}";
				
				pal.margins = [10,10,10,10];
				pal.grp = pal.add(res);
				
				pal.grp.enableDisable.help.preferredSize.width = pal.grp.enableDisable.help.maximumSize.width = pal.grp.enableDisable.help.minimumSize.width = 30;
				pal.grp.enableDisable.help.onClick = function () {alert(aeKeysData.strAbout, aeKeysData.scriptName);}
				
				pal.layout.layout(true);
				pal.grp.minimumSize = pal.grp.size;
				pal.layout.resize();
				pal.onResizing = pal.onResize = function () {this.layout.resize();}
			}
			
			return pal;
	}

			var aeKeysPal = aeKeysSetup_buildUI(thisObj);
			if ((aeKeysPal != null) && (aeKeysPal instanceof Window))
			{
			aeKeysPal.center();
			aeKeysPal.show();
				
			}
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I've just been learning how to create dockable panel scripts myself, using Jeff's scripts at redefinery.com as reference.

Give this a try:

Code: Select all

{
// aeKeysSetup Object
	function aeKeysSetup(thisObj)
	{
		var aeKeysData = new Object();
		aeKeysData.scriptName = "Shortcut Keys";
		aeKeysData.version = "0.3";
		aeKeysData.strHelp = "?";
		aeKeysData.strAbout = "Key Reference\n" +
		"\n" +
		"Created by, David Torno March, 2008\n" +
		"Additional resource's, help and inspiration...\n" +
		"-Redefinery - Lloyd Alvarez\n" +
		"-aescripts.com\n" +
		"-aenhancers.com\n" +
		"-Dan Ebberts and motionscript.com\n" +
		"-The world Wide Web and various books help make my brain\n" +
		" understand this Javascript thingy\n" ;

		// Build the interface   
		function aeKeysSetup_buildUI(thisObj)
		{
			var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", aeKeysData.scriptName, myFile, {resizeable:true});
			if (pal != null) {
         
				// Open file and read contents (hopefully).
				var myFile = fileGetDialog("Find the file","");
				if (myFile !=null){
   
					// open file
					var fileOk = myFile.open("r", "TEXT", "????");
					if (fileOk){
   
						var textArray = new Array();
						while (!myFile.eof){
							textArray[textArray.length] = myFile.readln();
							//if (text == "")
							//	text = "/r" ;
						}
         
						// close file before exiting
						myFile.close();

						var res =
							"group { \
								orientation:'column', alignment:['left', 'fill'], spacing:5, \
								text1: StaticText { text:'' }, \
								text2: StaticText { text:'' }, \
								text3: StaticText { text:'' }, \
							}";
            
						pal.margins = [10,10,10,10];
						pal.grp = pal.add(res);
            
						//pal.grp.enableDisable.help.preferredSize.width = pal.grp.enableDisable.help.maximumSize.width = pal.grp.enableDisable.help.minimumSize.width = 30;
						//pal.grp.enableDisable.help.onClick = function () {alert(aeKeysData.strAbout, aeKeysData.scriptName);}

						pal.grp.text1.text = textArray[0];
						pal.grp.text2.text = textArray[1];
						pal.grp.text3.text = textArray[2];
            
						pal.layout.layout(true);
						pal.grp.minimumSize = pal.grp.size;
						pal.layout.resize();
						pal.onResizing = pal.onResize = function () {this.layout.resize();}
         
						return pal;
					}
				}
			}
		}


		var aeKeysPal = aeKeysSetup_buildUI(thisObj);
		if ((aeKeysPal != null) && (aeKeysPal instanceof Window)) {
			aeKeysPal.center();
			aeKeysPal.show();
		}          
	}
	aeKeysSetup(this);
}
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

Those adjustments you made definitely gets the text into a dockable palette. Thank you very much.

Now the next hurdle. I added more lines...

Code: Select all

"group { \
orientation:'column', alignment:['left', 'fill'], spacing:5, \
text1: StaticText { text:'' }, \
text2: StaticText { text:'' }, \
text3: StaticText { text:'' }, \
text4: StaticText { text:'' }, \
text5: StaticText { text:'' }, \
text6: StaticText { text:'' }, \
text7: StaticText { text:'' }, \
text8: StaticText { text:'' }, \
text9: StaticText { text:'' }, \
text10: StaticText { text:'' }, \
and matched it here...

Code: Select all

pal.grp.text1.text = textArray[0];
pal.grp.text2.text = textArray[1];
pal.grp.text3.text = textArray[2];
pal.grp.text4.text = textArray[3];
pal.grp.text5.text = textArray[4];
pal.grp.text6.text = textArray[5];
pal.grp.text7.text = textArray[6];
pal.grp.text8.text = textArray[7];
pal.grp.text9.text = textArray[8];
pal.grp.text10.text = textArray[9];
Only the first three lines are getting read in though.

I would also like to skip/exclude the first X amount of lines in the text file, is that even possible? Thanks.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

It works for me when I make it ten lines, by pasting in your code. Make sure you close the panel and relaunch the script when you make changes.

To make it skip x number of lines at the start of the text file, insert the middle bit of code at around line 34, changing the value 3 to whatever you want:

Code: Select all

					// open file
					var fileOk = myFile.open("r", "TEXT", "????");
					if (fileOk){
						

						for (var a = 1; a <= 3; ++a) {
							myFile.readln();
						}
   

						var textArray = new Array();
						while (!myFile.eof){
							textArray[textArray.length] = myFile.readln();
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

Interesting, I WAS closing and relaunching. I even restarted AE. Hmmm... I'll keep trying and thanks for the extra code piece. I'll see if I can get it up and running on my machine. :)

Also is there any special URL or info you would like me to put into this script notes for a credit other than your name. You totally have made this thing come together. Thanks again.
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

DOH! :oops: Stupid mistake on my part. I was saving to a copy on the desktop, but running the old code from the ScriptUI folder. :oops: Sorry about that.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

vfxman wrote:Also is there any special URL or info you would like me to put into this script notes for a credit other than your name. You totally have made this thing come together. Thanks again.
Just a credit along with the others is cool. Can I ask what you're using the script for?
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

Just a freebie script to make a dockable window that loads the current AE shortcuts pref file so artists can have a hot key reference available at all times when working. This would end up including all of those obscure hotkeys that some people use once every blue moon, but have a need for on their current project. Plus this makes the artist aware of what can be cutomized (ex: if they never knew about this pref's file to begin with), has not been assigned yet and what he/she has already assigned. I think it would be a great tool to have when working on or off site.

If you were on site somewhere and using an unfamiliar machine, this script would show you what keys have been customized on that machine plus the key combo used. I need it for myself for the above reasons and for the fact that my memory is going to crap. ;)

I am noticing too that I need to make this window scrollable. This almost needs to have similar usability as the "Effects" palette. Minus the search option (save this for a future version).
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Here's a way to do it with a scrollable listbox, using Jeff Almasol's rd_ScriptLauncher_v2.2.jsx as reference.

Code: Select all

{
// aeKeysSetup Object
	function aeKeysSetup(thisObj)
	{
		var aeKeysData = new Object();
		aeKeysData.scriptName = "Shortcut Keys";
		aeKeysData.version = "0.3";
		aeKeysData.strHelp = "?";
		aeKeysData.strAbout = "Key Reference\n" +
		"\n" +
		"Created by, David Torno March, 2008\n" +
		"Additional resource's, help and inspiration...\n" +
		"-Redefinery - Lloyd Alvarez\n" +
		"-aescripts.com\n" +
		"-aenhancers.com\n" +
		"-Dan Ebberts and motionscript.com\n" +
		"-The world Wide Web and various books help make my brain\n" +
		" understand this Javascript thingy\n" ;

		// Build the interface   
		function aeKeysSetup_buildUI(thisObj)
		{
			var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", aeKeysData.scriptName, myFile, {resizeable:true});
			if (pal != null) {
         
				// Open file and read contents (hopefully).
				var myFile = fileGetDialog("Find the file","");
				if (myFile !=null){
   
					// open file
					var fileOk = myFile.open("r", "TEXT", "????");
					if (fileOk){
						
						for (var a = 1; a <= 3; ++a) {
							myFile.readln();
						}
   
						var textArray = new Array();
						while (!myFile.eof){
							textArray[textArray.length] = myFile.readln();
						}
         
						// close file before exiting
						myFile.close();

						var res =
							"group { \
								orientation:'column', alignment:['left', 'fill'], spacing:5, \
								listBox: ListBox {alignment:['fill','fill'] }, \
							}";
            

						pal.margins = [10,10,10,10];
						pal.grp = pal.add(res);
						
						// Workaround to ensure the edittext text color is black, even at darker UI brightness levels
						var winGfx = pal.graphics;
						var darkColorBrush = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
						pal.grp.listBox.graphics.foregroundColor = darkColorBrush;
						
						for (var x = 0; x < textArray.length; ++x) {
							pal.grp.listBox.add("item", textArray[x]);
						}
						
            			pal.grp.listBox.preferredSize.height = 100;
						
						pal.layout.layout(true);
						pal.grp.minimumSize = pal.grp.size;
						pal.layout.resize();
						pal.onResizing = pal.onResize = function () {this.layout.resize();}
         
						return pal;
					}
				}
			}
		}


		var aeKeysPal = aeKeysSetup_buildUI(thisObj);
		if ((aeKeysPal != null) && (aeKeysPal instanceof Window)) {
			aeKeysPal.center();
			aeKeysPal.show();
		}          
	}
	aeKeysSetup(this);
}
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

Paul is there a way to put the scroll on the palette itself? (beggers can't be choosers, I know, but it's worth asking) :D

The list box setup works great, but the white background is blaring in a dark interface.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

There are a number of ways to do this, but script UI isn't my strong point. Maybe someone else can offer some pointers?

I managed to get it working with a non-white scrollable StaticText element by changing the function to this:

Code: Select all

		// Build the interface   
		function aeKeysSetup_buildUI(thisObj)
		{
			var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", aeKeysData.scriptName, myFile, {resizeable:true});
			if (pal != null) {
         
				// Open file and read contents (hopefully).
				var myFile = fileGetDialog("Find the file","");
				if (myFile !=null){
   
					// open file
					var fileOk = myFile.open("r", "TEXT", "????");
					if (fileOk){
						
						// skip first 3 lines
						for (var a = 1; a <= 3; ++a) {
							myFile.readln();
						}
   
						var allText = myFile.read();
						myFile.close();

						pal.grp = pal.add("group");
						pal.grp.listBox = pal.grp.add("statictext",undefined, allText, {scrolling:true});						
						
						pal.grp.listBox.preferredSize.height = 100;

						pal.layout.layout(true);
						pal.minimumSize = pal.grp.listBox.size;
						pal.layout.resize();
						pal.onResizing = pal.onResize = function () {this.layout.resize();}
        
						return pal;
					}
				}
			}
		}
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

Ok, I've gotten this to a presentable state. I like the interface and the overall minial space it takes up. The listBox option you used eventually gave me an idea. So the new setup is this...

WARNING!!!! If you do run this script, it must be in the "ScriptsUI Panels" folder and launched from "Window" menu. I made this on mac, so it may not work on pc. Not sure though, I have no PC.

Code: Select all

{
	alert("WARNING!!!!!!\n" +
		"\n" +
		"Make sure this script is in your \"ScriptUI Panels\" folder and you run it from the \"Window\" menu!\n" +
		"\n" +
		"If you goofed and you didn't do the above, just hit cancel on the next screen, put things where they should be and relaunch script.\n" +
		"\n" +
		"Shortcut pref file default locations are:\n" +
		"\n" +
		"Mac = Users > \"username\" > Library > Preferences > Adobe > After Effects > 8.0\n" +
		"\n" +
		"Pc = C > Documents and Settings > \"username\" > Application Data > Adobe > After Effects > 8.0\n" +
		"\n")
		}
	  
{
// aeKeysSetup Object
   function aeKeysSetup(thisObj)
   {
      var aeKeysData = new Object();
      aeKeysData.scriptName = "Shortcut Keys";
      aeKeysData.version = ".70";
      aeKeysData.strHelp = "?";
      aeKeysData.strAbout = "About AE Shortcut Keys\n" +
      "\n" +
      "Assembled by: David Torno\n" +
	  "March, 2008\n" +
	  "\n" +
	  "This script hopefully will be updated at some point soon to what I really wanted it to look like, but it serves it's purpose for now. I hope you find it useful\n" +
	  "\n" +
      "Additional resource's, help and inspiration by...\n" +
	  "-EXTRA EXTRA EXTRA thanks to Paul Tuersley, he truely is the man!\n" +
      "-redefinery.com - Lloyd Alvarez\n" +
      "-aescripts.com\n" +
      "-aenhancers.com\n" +
      "-Dan Ebberts and motionscript.com\n" +
      "-The world Wide Web and various books which helped make my brain turn to mush, which then resulted in me sort of understanding this Javascript thingy\n" ;

      // Build the interface   
      function aeKeysSetup_buildUI(thisObj)
      {
         var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Shortcut Keys Reference", myFile, {resizeable:true});
         if (pal != null) {
         
            // Open file and read contents (hopefully).
			var myFile = fileGetDialog("Find the file","");
            if (myFile !=null){
   
               // open file
               var fileOk = myFile.open("r", "TEXT", "????");
               if (fileOk){
					

                 for (var a = 1; a <= 204; ++a) {
                     myFile.readln();
                  }
   
                  var textArray = new Array();
                  while (!myFile.eof){
                     textArray[textArray.length] = myFile.readln();
                  }
         
                  // close file before exiting
                  myFile.close();

                  var res =
                     "group { \
                        orientation:'row', alignment:['left', 'fill'], spacing:5, \
                        dropDownList: DropDownList {alignment:['fill','fill'] }, \
						aboutbutton: Group { \
						alignment:['left','top'], alignChildren:['left','top'], \
						help: Button { text:'" + aeKeysData.strHelp + "', alignment:['left','top']}, \
						},\
                     }";
           
                  pal.margins = [10,10,10,10];
                  pal.grp = pal.add(res);
                  
                  // Workaround to ensure the edittext text color is black, even at darker UI brightness levels
                  var winGfx = pal.graphics;
                  var darkColorBrush = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
				  pal.grp.dropDownList.graphics.foregroundColor = darkColorBrush;
                  
                  for (var x = 0; x < textArray.length; ++x) {
                     pal.grp.dropDownList.add("item", textArray[x]);
                  }
                  
                  pal.grp.dropDownList.preferredSize.height = 10;
				  pal.grp.dropDownList.selection = 0;

				  pal.grp.aboutbutton.help.onClick = function () {alert(aeKeysData.strAbout, aeKeysData.strAboutTitle);}
                  pal.layout.layout(true);
                  pal.grp.minimumSize = pal.grp.size;
                  pal.layout.resize();
                  pal.onResizing = pal.onResize = function () {this.layout.resize();}
         
                  return pal;
               }
            }
         }
      }


      var aeKeysPal = aeKeysSetup_buildUI(thisObj);
      if ((aeKeysPal != null) && (aeKeysPal instanceof Window)) {
         aeKeysPal.center();
         aeKeysPal.show();
      }         
   }
   aeKeysSetup(this);
}
It's totally dockable, takes up very little space, loads the text correctly. The only hang up is that if you do dock it, and then close AE, you are prompted to locate the file when you start AE again. So my next question is, how do I get this to point to the file automatically or at least have the user write it in the script once and it just loads. I've tried writing an absolute path to the file using variations of File.absoluteURI, relativeURI, file.open, eval, but have had no success. The Javascript Tools PDF is informative and not all at the same time. I am catching on quick though. :)
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I've made it so it should automatically find the shortcut file on Mac or Windows (untested):

Code: Select all

/*{
   alert("WARNING!!!!!!\n" +
      "\n" +
      "Make sure this script is in your \"ScriptUI Panels\" folder and you run it from the \"Window\" menu!\n" +
      "\n" +
      "If you goofed and you didn't do the above, just hit cancel on the next screen, put things where they should be and relaunch script.\n" +
      "\n" +
      "Shortcut pref file default locations are:\n" +
      "\n" +
      "Mac = Users > \"username\" > Library > Preferences > Adobe > After Effects > 8.0\n" +
      "\n" +
      "Pc = C > Documents and Settings > \"username\" > Application Data > Adobe > After Effects > 8.0\n" +
      "\n")
      }
 */   
{
// aeKeysSetup Object
   function aeKeysSetup(thisObj)
   {
      var aeKeysData = new Object();
      aeKeysData.scriptName = "Shortcut Keys";
	  aeKeysData.version = ".70";
      aeKeysData.strHelp = "?";
	  aeKeysData.onWindows = ($.os.indexOf("Windows") != -1);
	  aeKeysData.prefVersion = parseInt(app.version).toString() + ".0";
      aeKeysData.strAbout = "About AE Shortcut Keys\n" +
      "\n" +
      "Assembled by: David Torno\n" +
     "March, 2008\n" +
     "\n" +
     "This script hopefully will be updated at some point soon to what I really wanted it to look like, but it serves it's purpose for now. I hope you find it useful\n" +
     "\n" +
      "Additional resource's, help and inspiration by...\n" +
     "-EXTRA EXTRA EXTRA thanks to Paul Tuersley, he truely is the man!\n" +
      "-redefinery.com - Lloyd Alvarez\n" +
      "-aescripts.com\n" +
      "-aenhancers.com\n" +
      "-Dan Ebberts and motionscript.com\n" +
      "-The world Wide Web and various books which helped make my brain turn to mush, which then resulted in me sort of understanding this Javascript thingy\n" ;

      // Build the interface   
      function aeKeysSetup_buildUI(thisObj)
      {
         var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Shortcut Keys Reference", myFile, {resizeable:true});
         if (pal != null) {
         
            // Open file and read contents (hopefully).

			if (aeKeysData.onWindows) {		
				var myFile = new File("~/Application Data/Adobe/After Effects/"+aeKeysData.prefVersion+"/Adobe After Effects "+
				aeKeysData.prefVersion+" Shortcuts");
			} else {		
				var myFile = new File("~/Library/Preferences/Adobe/After Effects/"+aeKeysData.prefVersion+"/Adobe After Effects "+
				aeKeysData.prefVersion+" Shortcuts");
			}
		
			if(myFile.exists == false) {
				var myFile = fileGetDialog("Find the file",""); 
			}

			if (myFile != null && myFile.exists){
				
               // open file
               var fileOk = myFile.open("r", "TEXT", "????");
               if (fileOk){
               

                 for (var a = 1; a <=204; ++a) {
                     myFile.readln();
                  }
   
                  var textArray = new Array();
                  while (!myFile.eof){
                     textArray[textArray.length] = myFile.readln();
                  }
         
                  // close file before exiting
                  myFile.close();

                  var res =
                     "group { \
                        orientation:'row', alignment:['left', 'fill'], spacing:5, \
                        dropDownList: DropDownList {alignment:['fill','fill'] }, \
                        aboutbutton: Group { \
                           alignment:['left','top'], alignChildren:['left','top'], \
                           help: Button { text:'" + aeKeysData.strHelp + "', alignment:['left','top']}, \
                        },\
                     }";
           
                  pal.margins = [10,10,10,10];
                  pal.grp = pal.add(res);
                  
                  // Workaround to ensure the edittext text color is black, even at darker UI brightness levels
                  var winGfx = pal.graphics;
                  var darkColorBrush = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
                  pal.grp.dropDownList.graphics.foregroundColor = darkColorBrush;
                  
                  for (var x = 0; x < textArray.length; ++x) {
                     pal.grp.dropDownList.add("item", textArray[x]);
                  }
                  
                  pal.grp.dropDownList.preferredSize.height = 10;
                  pal.grp.dropDownList.selection = 0;

                  pal.grp.aboutbutton.help.onClick = function () {alert(aeKeysData.strAbout, aeKeysData.strAboutTitle);}
                  pal.layout.layout(true);
                  pal.grp.minimumSize = pal.grp.size;
                  pal.layout.resize();
                  pal.onResizing = pal.onResize = function () {this.layout.resize();}
         
                  return pal;
               }
            }
         }
      }


      var aeKeysPal = aeKeysSetup_buildUI(thisObj);
      if ((aeKeysPal != null) && (aeKeysPal instanceof Window)) {
         aeKeysPal.center();
         aeKeysPal.show();
      }         
   }
   aeKeysSetup(this);
}
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

For those looking for the final version, it can be found here...

viewtopic.php?f=3&t=969

This script can be tweaked fairly easily to adjust for a different text document also.
Post Reply