2009-03-17, 21:56
i am in the process of migrating my MythTV HTPC to a mac mini running XBMC. all my video/music/picture libraries have been setup nicely, but i ran into one small problem: i share a house with a lot of people and i know some of them are going to attempt to use this as a terminal to the Internet (which i would like to avoid). my solution was to write a small apple script that looped looking to see if the XBMC process was closed, if so, it reopens it. the following is how i accomplished this:
to setup: simply save the above script as an application (i saved it in /Applications/) then make it a startup item for the respective user profile.
*note: i fully realize that any user with above moderate knowledge of computers could get around this, but those aren't the users im trying to keep off other processes on this htpc.
hope this is useful to someone else out there
Code:
repeat
tell application "System Events" to set xbmc to (name of processes) contains "XBMC"
# open XBMC if closed
if xbmc = false then
tell application "XBMC" to activate
end if
# force XBMC to be the app in focus
tell application "XBMC" to activate
delay 15
end repeat
to setup: simply save the above script as an application (i saved it in /Applications/) then make it a startup item for the respective user profile.
*note: i fully realize that any user with above moderate knowledge of computers could get around this, but those aren't the users im trying to keep off other processes on this htpc.
hope this is useful to someone else out there