How to use environment variables in applescript

Try this:

log "Glassfish Home: " & (system attribute "AS_HOME")