About controlling Preview via Applescript: Help: Change the Color of the Selected Object in Preview
For more information, see the wiki Searching the Forum for Answers section.