The photoproduction of $omega$ and $eta^prime$ mesons off carbon and niobium nuclei has been measured as a function of the meson momentum for incident photon energies of 1.2-2.9 GeV at the electron accelerator ELSA. The mesons have been identified via the $omega rightarrow pi^0 gamma rightarrow 3 gamma$ and $eta^primerightarrow pi^0 pi^0eta rightarrow 6 gamma$ decays, respectively, registered with the CBELSA/TAPS detector system. From the measured meson momentum distributions the momentum dependence of the transparency ratio has been determined for both mesons. Within a Glauber analysis the in-medium $omega$ and $eta^prime$ widths and the corresponding absorption cross sections have been deduced as a function of the meson momentum. The results are compared to recent theoretical predictions for the in-medium $omega$ width and $eta^prime$-N absorption cross sections. The energy dependence of the imaginary part of the $omega$- and $eta^prime$-nucleus optical potential has been extracted. The finer binning of the present data compared to the existing data allows a more reliable extrapolation towards the production threshold. The modulus of the imaginary part of the $eta^prime$ nucleus potential is found to be about three times smaller than recently determined values of the real part of the $eta^prime$-nucleus potential, which makes the $eta^prime$ meson a suitable candidate for the search for meson-nucleus bound states. For the $omega$ meson, the modulus of the imaginary part near threshold is comparable to the modulus of the real part of the potential. As a consequence, only broad structures can be expected which makes the observation of $omega$ mesic states very difficult experimentally.