Aligning Objects within Groups

I was doing a demo of the Plug-In Pro awhile back and we got into a discussion of how it is a hassle if objects within a group (such as a multiple choice question) have gotten moved around slightly. I came up with the script to the left to deal with that. You figure out the desired left coordinate (4403 page units in this example), select the group, and then press Enter in the Command Window. The getObjectListfunction grabs all the objects within the selected object (group). We then pop each item from the list into a separate variable and set the x coordinate (item 1 of position) to the desired value. Note that passing FALSE to getObjectList means that all matching objects are included, regardless of whether they have a script.

leftVal = 4403

objList = getObjectList(selection, "", FALSE)

while objList <> null
	pop objList into objId
	item 1 of position of objId = leftVal
end while

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: Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: