2 Replies Latest reply on Jul 19, 2013 12:46 PM by dgaines

    Prompt User

    dgaines Apprentice

      I need to prompt a user to do something before installing software.   I would like to pop up a message on the user's screen, give them the ability to ok the actions that is described to them on the screen or allow them to postpone it for a time.   It is something similar to how we are able to do that via LANDesk on the windows side of things.   I have tried launching an apple script via  sudo command in a script.  The app runs, comes up on the user's tray, but it doesn't display anything in the user space beyond that.  How do other people handle this?  Any suggestions are most welcome.

        • 1. Re: Prompt User
          csoto Specialist

          Have you tried an "osascript" command in a normal Managed Script?  For example:

           

          [MACHINES_MAC]

          REMEXEC0=/usr/bin/osascript -e 'tell app "System Events" to display dialog "Hello World!"'

           

          Better yet, include that statement in a shell script you deploy and call via the Managed Script.  If you need to branch based on the button that was pushed, it will return either "OK" or an error ("Cancel").

          • 2. Re: Prompt User
            dgaines Apprentice

            Thanks for the suggestion, when i try your example on my 10.8.4 machine I get an error:

             

            2013-07-19 13:54:18.918 osascript[1795:707] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found.  Did find:

                    /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper

            osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.

            28:57: execution error: An error of type -10810 has occurred. (-10810)

             

            Any thoughts?  Thanks

            2013-07-19 13:54:18.918 osascript[1795:707] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found.  Did find:

                    /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper

            osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.

            28:57: execution error: An error of type -10810 has occurred. (-10810)

             

            I did find that if I ran REMEXEC313=sudo /tmp/LANDesk\ Prompt.app/Contents/MacOS/applet for example, on my 10.6 test machines it prompted them like I wanted, but when it ran on the 10.8 machines it didn't prompt.  The only thing on the screen was an icon did appear in the tray.  Thanks