/*

Randomdistribute Version 1.0 | a Scriptographer 2.0 script
Randomly distributes objects within the document.

Scriptographer is a plugin for Adobe Illustrator(TM)
created by Jürg Lehni
http://www.scriptographer.com/

This script was written by Eike Menijn 
http://subfuse.net

*/

var array = null;
var obj = null;
var x = null;
var y = null;

rand();

function rand() {
	array = activeDocument.getSelectedItems();
	for (var i = 0; i < array.length; i++) {
		obj = array[i];
		var x = Math.random()*(activeDocument.getSize().x-obj.bounds.width) - obj.bounds.x;
		var y = Math.random()*(activeDocument.getSize().y-obj.bounds.height) - obj.bounds.y;
		obj.translate(x,y);
	}
}

