runscript: make sure to get the correct extension point to run

Really fix #4371 and ticket #14776