A new strategy of using complex absorbing potentials (CAPs) within electronic structure calculations of metastable electronic states, which are ubiquitous in chemistry and physics, is presented. The stumbling block in numerical applications of CAPs is the necessity to optimize the CAP strength for each system, state, and one-electron basis set, while there is no clear metric to assess the quali...