Script help for Viewport toggle button

I don’t know scripting so I’m hoping someone can help he out here. I just purchased a 3D connexion space mouse and want to assign the right mouse button to toggle between perspective view and plan view, but only on my top right viewport. How would I go about doing this?
Thanks

Hi Jeremy - assuming you keep the default viewport names this macro should help:

'_SetActiveViewport “Top”
-_ViewportProperties
_Projection _Toggle
_EnterEnd

-Pascal

Excellent!
Thanks,
Jeremy