Multiple Actions with One Button

Does anyone have a solution for a script to run AND a URL to open when a button is pressed? I need actions within the base to be performed, but I also would like to redirect the user to a confirmation page once the button is pressed.

I also have a near-identical use-case where I need to guide users to open a URL via a button to edit details on a record in another base, but I’d like to be able to know that they clicked it. Is there any clever way to additionally trigger an automation when the button is pressed (along with having the url open)?

Thank you!