my 2cents, re-difine the Xattach command in the on-open lisp, calling the getfiled function before the command and set switches to that location....
or create a similar named command example Xattach2, I'd start it with the Xattach so it appears in the tooltip list as you are typing it, just below the normal Xattach command.