This is just a quick post about an AppleScript issue I’ve been having since Snow Leopard. I have a login script that maps network drives and needs the current username to do so. I use to use this command in my AppleScript.

tell application "System Events"
set user_name to get name of current user
end tell

Under Snow Leopard, this presents the user with an error that it can’t find the location of “System Events.app” and they have to click cancel. After much research, I found others having the same issue and I believe it’s replated to imaging and chaching of system apps. Long story short, I found a better way to get the current username that doesn’t produce any errors.

set user_name to (short user name of (system info))