Referencing pop-up modal windows while running AppleScripts

Am doing GUI scripting with Mac’s Safari. Have gotten to the point where a nameless modal window pops up with two buttons: “Cancel” and “Remove Now”. In order to script an automatic response, the modal window needs a reference. How does one find it? The scripted command

click button “Remove Now” of front window

Any help greatly appreciated.

Model: MacBook Pro
AppleScript: 2.4
Browser: Safari 605.1.15
Operating System: Mac OS X (10.13 Developer Beta 3)

It turns out that the modal window is considered part of the original window, thus the command

click button “Remove Now”

works fine.