Send a message to multiple scripts within an Array - Javascript

I did a little bit of google searching and there are not many threads on this, and the API description doesn’t clear it up for me.

I’ve got this script so far, but it’s giving me errors.

#pragma strict

var populateArray:		boolean = false;
var objects: 			GameObject[];

function Update () 
	if (populateArray)
		Populate ();
		objects = [];

function Populate ()
	objects = GameObject.FindGameObjectsWithTag("farmer");
	for(var Cube in objects)


Basically I have several test cubes in my scene, all tagged “farmer”. Some have a script named “script01” and some have a script named “script02” But both those scripts have a function called “Test”

I’m trying to create an array, fill it with every object in the scene, then execute the function “Test” to every object within the array, using send.Message.

However, I’m clearly missing a step here, can anyone offer some clarity into what I’m doing wrong?

Showing the error would help in figuring out what exactly is wrong…

But as a blind stab in the dark, I’d suggest typing your foreach variable: for(var Cube : GameObject in objects)