HOW TO: Get Servoy Server to Start on Mac OS X

Hi all,
I have had problems to get Servoy server to start on its own on Mac OS X using Startup Items. Servoy seems to start before Sybase is ready.

Someone suggested writing an AppleScript to get around this. You can execute the AppleScripts at startup by saving them as Applications, Adding them to the “Startup Items” in “Accounts” System Preference Panel.

The scripts assumes you have worked out how to start the database holding your Servoy Repository and any other databases you need to use. Marc Liyanage’s site www.entropy.ch has startup items for mySQL and PostgreSQL.

Applescript to Start Servoy when repository is in Sybase:

on idle
	copy (do shell script "ps axU root") to t
	-- get list of processes owned by root
	-- look for Sybase ASA
	if t contains "dbsrv9" then
		-- delay 30 secs to make sure Sybase has started
		delay 30
		-- Start Servoy, ignoring any results
		-- Replace YOURPASSWORDHERE with your root password.
              -- Maybe this a security risk?
		do shell script "/Applications/Servoy/servoy_server.sh > /dev/null 2>&1 &" password "YOURPASSWORDHERE" with administrator privileges
              -- quit the script
		quit me
	end if
end idle

When repository is in PostgreSQL:

on idle
	copy (do shell script "ps axU postgres") to t
       -- PostgreSQL starts a number of different processes
	if t contains "postmaster" and t contains "postgres" then
       	delay 30
-- Replace YOURPASSWORDHERE with your root password.
		do shell script "/Applications/Servoy/servoy_server.sh > /dev/null 2>&1 &" password "YOURPASSWORDHERE" with administrator privileges
              -- quit the script
		quit me
	end if
end idle

These seem to work fine.
Any suggestions for improvements appreciated.