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-
M-x emacs-version
ad some more characters here......
Sorry, from .emacs, just call
(emacs-version)