Indesign stroke question

tell application "Adobe InDesign CS3"
	set myBigRectangle to selection
	set stroke weight of myBigRectangle to 20
end tell

This returns an error:

error “Can’t set «class lnwt» of {«class crec» id 227 of «class page» id 199 of «class sprd» id 215 of document "Untitled-4" of application "Adobe InDesign CS3"} to 20.” number -10006 from «class lnwt» of {«class crec» id 227 of «class page» id 199 of «class sprd» id 215 of document “Untitled-4”}

But this works without a hitch…

tell application "Adobe InDesign CS3"
	set stroke weight of selection to 20
end tell

Can someone tell me what gives? Is this just bizarre Adobe behavior, or am I missing a fundamental of AS?

If you look at what is returned from a selection it is a list of objects. Even if you only have one object selected you get a list of objects. So you need to specify the item in the list that you want to change. So try changing:

myBigRectangle

to

item 1 of myBigRectangle

I can see clearly now, the rain is gone.

Well, gone until the next hurdle.

Thanks! This is fun to learn.