I have two Emacs (Aquamacs and text-based Emacs) on my Mac.
In my .emacs file, I can check if I\'m using Aquamacs with ...
.emacs
(boundp \'aquamacs-
(if (window-system) "window-based" "text-based")