Tracking macro

Is it possible to make a macro like this except have it turn on beast and human tracking when holding alt but turn off beast and human tracking when not holding alt?

/run for l=1,C_Minimap.GetNumTrackingTypes() do i=C_Minimap.GetTrackingInfo(l); if(i.name=="Track Humanoids")then t=not i.active; C_Minimap.SetTracking(l, t); m="OFF"; if(t)then m="ON"; end print("Track Humanoids "..m); end end