Get Info "static text" and "scroll areas" numbers

The following command does not return the “Name & Extension” of the Get Info (i.e. the front window in my app) in Mojave, because the the numbers for the text field appear to have changed.

tell application "System Events" to tell process "Finder" to set R to value of static text 19 of scroll area 1 of front window

Does anyone know the correct numbers for the Get Info “static text” and “scroll areas” that will return the value for the filename instead of the label text, “Name & Extension”?

I didn’t get the numbers that you were looking for but using Script Debugger 7 to inspect the elements I found that the following script would return the filename with extension of the Get Info window if that window was the frontmost Finder window. I am not using Mojave but don’t believe that should make a difference for this small script. Does that help?

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application "Finder"
	set R to displayed name of (get item of window 1)
end tell

The script also works as a single line script if you prefer that format.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application "Finder" to set R to displayed name of (get item of window 1)

Thank you. This seems to work.