OpenScript to Get an Alphabetized List of Objects on a Page

I’m working on a new version of the Storyboarder utility and wanted to get a list of all the object names on a page so that I could read the values of the various fields, checkboxes, and comboboxes. Since ToolBook OpenScript doesn’t have any type of IntelliSense where the editor helps you with the object names, you must come up with them on your own. It is a pain to keep closing the editor (which is modal in ToolBook) to go find the object name, so I used the script below to make a list of names. I can then put this in TextPad and grab the object names as I need them. I thought someone else may find it useful. Just paste it into the Command Window and press Enter. There are lots of scripts like this in The ToolBook Companion, but using OpenScript and the Command Window is something of a lost art:).

objList = getObjectList(this page, "", FALSE) 
nameList = "" 
while objList <> null  
     pop objList into objId  
     if name of objId <> null   
          push name of objId onto nameList  
     end if 
end while 
nameList = sortList(nameList) 
put listToTextline(nameList)

Here’s a partial list of the result:

includePageIdsBox
includePageNamesBox
includePageNumbersBox
includeQuestionsBox
includeRecordfieldsBox
includeScreenCapturesBox
includeSimulationsBox
pageRangeGroup
powerboardDirectory
powerboardDirectoryBtn

Advertisements

About Jeff Rhodes
Jeff Rhodes is the Chief Technical Officer and owner of Platte Canyon Multimedia Software Corporation, a leader in developing commercial software that Improves the Lives of Training Developers. He graduated at the top of his class at the Air Force Academy, where he earned a Bachelor of Science in Electrical Engineering. Jeff received a Masters degree in Economics from the London School of Economics, which he attended under a British Marshall Scholarship. Jeff is the author of "Programming for e-Learning Developers: ToolBook, Flash, JavaScript, & Silverlight" and "VBTrain.Net: Creating Computer and Web Based Training with Visual Basic .NET." He also co-wrote "The ToolBook Companion." He has had numerous articles on training development published and is a frequent presenter at conferences both in the U.S. and Europe. Jeff lives in Colorado Springs with his wife Sue and sons Derek and Michael.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: