Use beginSheetModalForWindow instead of runModal.