First off, please answer Koz’s question about the Audacity version. If you cannot use Audacity > About Audacity, open Finder, Go > Go to Folder and type:
~/Library/Application Support/audacity/
In that “audacity” folder, open audacity.cfg using Textedit. The three-digit version number of Audacity should be at the top of audacity.cfg.
Were you saving a project or exporting an audio file?
If you pressed Delete by accident you could Edit > Undo the delete, if you can make Audacity respond.
If Audacity is not responding you could try pressing the yellow Stop button.
Audacity could also not respond if you were saving or exporting to an external drive or network location that is not available.
If your Audacity temporary directory is set to the same unavailable place the waveform may disappear, though if so, it should disappear every six seconds during the recording. The Audacity temporary directory is listed at Audacity > Preferences: Directories, or you can find out the temporary directory under [Directories] in audacity.cfg (see above).
Also make sure you are not running Audacity from the DMG or Audacity will default to save and export there. See: Installation: Do NOT run Audacity from the DMG!!!! . You cannot write to the DMG.
If it’s a 1.3 or 2.0.x version of Audacity you should be able to force quit and recover the recording - if the data you recorded is accessible. The data is in the temporary directory noted above.
To be safe, you could use Finder to go to the temporary directory, copy the folder, then paste it somewhere you have permission to write, such as your Desktop.
Gale