Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

AppleScript from Unity

Discussion in 'Scripting' started by htwarrior, Oct 4, 2006.

  1. htwarrior

    htwarrior

    Joined:
    Feb 25, 2006
    Posts:
    40
    Hi. Is there a way of executing an Apple Script from Unity ? . For Example, I want to shutdow my computer after closing a Unity application with Quit (I dont want anybody to use my computer other than for playing my game :) ) . But, if I use another combination of keys only the application quit , for example quit + option.


    Any ideas
    htwarrior
     
  2. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    You can use AppleScript in Unity by using a shell() command from JavaScript or Boo with the osascript command. Also there is a preference in the Unity Player settings that ignores Command-Q quits and lets you do your own quitting.

    As for creating a kiosk, you probably want to not bother with an AppleScript type thing and read this technical note instead:

    http://developer.apple.com/technotes/tn2002/tn2062.html

    Hope that helps,
    -Jon