<div>I like to use Applescript to display windows because it is so easy. You can even call it from a shell script like so:</div><div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace">#!/bin/sh</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">#script your commands here</font></div><div><font class="Apple-style-span" face="'courier new', monospace">touch file1</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">#this is the window block</font></div><div><font class="Apple-style-span" face="'courier new', monospace">/usr/bin/osascript << EOF</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">tell application "Finder"</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> activate</font></div>
<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span><font class="Apple-style-span" face="'courier new', monospace">display dialog "Running Maintenance Tasks" buttons {"Finish IT!"} with icon caution</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">end tell</font></div><div><font class="Apple-style-span" face="'courier new', monospace">EOF</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">#final command runs after button is pressed</font></div><div><font class="Apple-style-span" face="'courier new', monospace">touch file2</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">exit</font></div></div><div><br></div><div>Here is the pastebin link if the email gets munged. <a href="http://pastebin.com/m454c9c14">http://pastebin.com/m454c9c14</a></div>
<br clear="all">Ryan M. Manly<br>Mac OS X Expert<br>Glenbrook High Schools<br>1835 Landwehr Rd.<br>Glenview, IL 60026<br>(847) 486-4948<br>
<br><br><div class="gmail_quote">On Thu, Nov 5, 2009 at 10:44 AM, Thomas Larkin <span dir="ltr"><<a href="mailto:tlarki@kckps.org">tlarki@kckps.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">So, I am trying to run some automation with a bit of end user interaction. If I use the jamf displayMessage binary to display a message it will return the output back into terminal, but I can't seem to quite make the connection.</font> </p>
<br>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">Basically I want to run the command along with other commands and then the user clicks on the OK button it will trigger the last or final command of the policy.</font> </p>
<br>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">Here is what I got, proof of concept wise, but it is very very broken. Anyone else got any ideas?</font> </p>
<br>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">#!/bin/bash</font> </p>
<br>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">#test jamf display message command</font> </p>
<br>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">selection=</font> </p>
<br>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">/usr/sbin/jamf displayMessage -message "testing"</font> </p>
<br>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">until [ "$selection" = "button returned: OK" ] ; do</font> </p>
<br>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">case $selection in</font> </p>
<br>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">"button returned:OK" ) /bin/echo "the test is over" ;;</font> </p>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande"> esac</font> </p>
<p style="margin-bottom:0;margin-top:0">
<font size="3" face="Lucida Grande">done</font>
</p>
<br>___________________________<br>Thomas Larkin<br>TIS Department<br>KCKPS USD500<br><a href="mailto:tlarki@kckps.org" target="_blank">tlarki@kckps.org</a><br>blackberry: 913-449-7589<br>office: 913-627-0351<br>chown -R us /.base<br>
<br><br><br><br><br></div>
<br>_______________________________________________<br>
Casper mailing list<br>
<a href="mailto:Casper@list.jamfsoftware.com">Casper@list.jamfsoftware.com</a><br>
<a href="http://list.jamfsoftware.com/mailman/listinfo/casper" target="_blank">http://list.jamfsoftware.com/mailman/listinfo/casper</a><br>
<br></blockquote></div><br>