MacAdmininstrator and AppleScript

By: Mike Kimball - Revised: 2006-06-13 devin


This page lists some of the additional functionality we have added through the use of AppleScript applications, run as Agents (either at login, logout, or startup).


Download Script – HQX-File, 7.5 KB

Also named "Login as RevRdist" in the Agents folder, this script solves a piece of the problem of getting RevRdist to run at a specified time (usually a time when the lab is closed). The script retains the RevRdist user login info (the password visible in the script is concealed with a rotate function) - it writes some xml info to the MacAdmin Remote Messages file, which actually triggers the Mac to log in as the RevRdist user (this Remote Messages file gets deleted by MacAdmin, which theoretically removes the vulnerability of that file's contents). Note: you will have to enter your own name and password in this script.

Login check (run rr)

Download Script – HQX-File, 1.4 KB

This script requires the MacAdmin Client OSAX scripting addition to work. It runs at startup as a MacAdmin Agent - it checks to see if the "revrdist" user is logged in, and if so, runs our Run RevRdist script.

There are two issues that the revrdist login scripts address. One, we do not run RevRdist at every shutdown (restart, startup) because we find it too much of an inconvenience to our patrons. We feel that with adequate protections, and decent cleanup scripts, once a night should be sufficient for the most part. We can also run it manually anytime we want to. Two, we have found that RevRdist currently will not run while the Mac is in Screen Save mode - if it does, it will hang the machine (this is similar to a problem that existed with previous versions of MacAdmin, where running RevRdist at any time would hang the Mac at the point where RevRdist tries to quit the Finder and restart).


Download Script – HQX-File, 3.5 KB
This script is run on demand by either using our Hot Key specification for it (we chose alt-F12, this is set by the Keyboard control panel and not by the MacAdmin client - the client has had its logout short key removed) or by using an alias we place on the desktop of the Mac. The script gives a dialog prompting the user if they really want to log out and gives them 15 seconds to cancel (logout is the default). This helps to alleviate accidental logout.

logout dialog

For more info about the Logout Short Key or the customized Desktop, please see the Customization section.

Logout cleanup

Download Script – HQX-File, 30.6 KB

This script requires the "finger of death" (FOD) scripting addition. This script is triggered on logout as a MacAdmin Agent. The script does the following to cleanup the appearance:
  • Kills the Kerberos palette
  • Kills the App Switcher palette
  • Moves all extraneous desktop items to the Documents folder, uses a timestamp to name the containing folder
  • Repositions the default items on the desktop
  • Resets the screen resolution, desktop picture, etc to our defaults
  • Sets the desktop View preferences to Icon (instead of buttons)
  • Backs up the RevRdist Status file (this may become an obsolete function)
  • Quits faceless apps (includes a dontQuitTheseApps function that leaves certain apps running such as AppleScript and ScriptEditor, for testing purposes, as well as things required by MacAdmin)