Assigning spacebar to mouse-left-click is probably a bad idea since you won't be able to type spaces in text. As a general note about macros, you could use Altium's macro language, but a simpler way is use a macro program such as AutoHotKey (AHK). You can set up AHK where specific macro sets are only executed for the currently active program. If the current active program isn't identified in the script, AHK will pass along the keyboard commands unaltered. Since Altium is such a poky program, some commands need long delays, somewhere between 50ms to 100ms. Mouse clicks may need 100ms.
This sample script for Altium and LTspice, which resides in a single text file, should be enough to get you going quickly.
#SingleInstance ignore
SetTitleMatchMode, 2
; key modifiers !=alt ^=ctrl +=shift
#IfWinActive, Altium Designer
F1:: ; Wire Mode
Send, ^w
return
F7:: ; PCB, toggle ref designation visibility
SetKeyDelay, 50
MouseClick, right
Send, ed{esc}
SetKeyDelay, 10
return
F10:: ; Pan to center
Send, {Home}
return
return
#IfWinActive, LTspice
F10:: ; FFT
Click, 344, 105
Send, !V
Click, 72,171
Send, {Enter}
return
return