F10 already does that. If you are wanting to re-assign that to F4, do a search for AddKeyBinding, there is some examples on support. There is also some example scripts in your \MentorGraphics\EEVX.1.2\SDD_HOME\standard\examples\pcb\Automation\Scripts\ directory. Take a look at KeyBindings.vbs
Here are a couple of links from SupportNet:
This one should be in help as well, https://supportnet.mentor.com/docs/201303047/docs/htmldocs/mgchelp.htm#context=dxdesigner_auto&href=DxDesigner_Automatio…