This is something I borrowed from here: http://www.hulubei.net/tudor/configuration/download/.emacs
I have not tested the code, but it looks like it should work. With this type of setup, the original poster can maintain just one
.emacs file and/or load the preferences file.
(defvar gnuemacs-flag (string-match "GNU" (emacs-version)))
(defvar aquamacs-flag (string-match "Aquamacs" (emacs-version)))
(define-key osx-key-mode-map (kbd "A-h") 'replace-string))
(define-key key-minor-mode-map (kbd "s-h") 'replace-string)))