Get current app from two instances with same name by Apple Script
It's not possible to get the right instance of the frontmost application because these two instances have the same path and the same bundle identifier, the application will always be the first open instance. 

You must use the frontmost process, like this:

tell application "System Events"
    tell (first process whose frontmost is true) to tell front window to if exists then
        set position to {0, 0}
        set size to {dtw, dth}
    end if
end tell