Not sure what behavior you are expecting. I would expect this function to not return the filenames with .fmp12 attached.
Are you seeing mistaken data? EG you set an actual window name using the "set window title" script step, and then that custom name is not being returned?
In FileMaker pro, the default window title is the same thing, filename sans the file extension, followed by the server (if hosted) in parentheses.
i was not setting the window title at all. just forgot the default unaltered window title is the filename