There isn't a way to macro it...per se.

You can have them target the NPC of interest, and have Interact With Target bound and pressed for them to open the dialog. If you also enable click-to-move in the mouse setting they will walk in to range to open the dialog. This will be about the only way to accomplish what you are asking.