{ //The light med and heavy values are used for their corresponding grid densities //Change them if you want. int $lightSpacing = 50; //Value for lighter grid density int $medSpacing = 10; //Value for medium grid density int $heavySpacing = 5; //Value for heavy grid density int $currentSpacing = `grid -q -spacing`; //Value for current grid density string $gridSpacingHeadsUP = "Grid spacing is "; //Value for heads up message //If equal to lightSpacing & greater than medSpacing //set grid spacing to medium & print heads up msg. if (($currentSpacing <= $lightSpacing) && ($currentSpacing > $medSpacing )){ grid -spacing $medSpacing; headsUpMessage ($gridSpacingHeadsUP + $medSpacing); //If less/equal to medSpacing & greater than heavySpacing //set grid spacing to heavy & print heads up msg. }else if (($currentSpacing <= $medSpacing) && ($currentSpacing > $heavySpacing )){ grid -spacing $heavySpacing; headsUpMessage ($gridSpacingHeadsUP + $heavySpacing); //If equal/less than heavySpacy set grid spacing to light & print heads up msg. }else if ($currentSpacing <= $medSpacing){ grid -spacing $lightSpacing; headsUpMessage ($gridSpacingHeadsUP + $lightSpacing); } }