Here's a script for pushing a button in System Preferences. It may be useful as a starting point. Good luck! It took me a lot of trial and error to get this little snippet working.
Code:
-- Stop and restart TiVo Desktop (starts it if it's not already running)
tell application "System Preferences"
set current pane to pane "TiVo Desktop"
tell application "System Events" to tell process "System Preferences"
if exists button "Stop" of window "TiVo Desktop" then
click button "Stop" of window "TiVo Desktop"
end if
delay 2
if exists button "Start" of window "TiVo Desktop" then
click button "Start" of window "TiVo Desktop"
end if
end tell
quit
end tell It runs silently. At least on Leopard, all you see is the white-blue dot in the Dock under the System Preferences icon.