ok ive been tinkering with this for a while and there seems to only be one way to get this to work IF you want it to change to focus target based on a modifier key (if you just want it to always target the focus then a simple @focus macro works just fine)
the Best solution i have found (so far, still working on it
is a two part macro)
FIRST make this macro and put it somewhere on your action bars (anywhere is fine, probably out of the way or on a hidden bar because
you will NOT click this macro, but it does need to be out on your bars)
Code:
#showtooltip
/cast [pet:Crane, @focus] Lullaby
/cast [pet:Spider, @focus] Web
(note: there is unfortunately no way that i have found for this to work in a generic way that will apply to any pet, so you need to put in the pet type and the ability name, fortunately since this is all you need for this first macro, you should be able to fit in at least 5 pet types)
Now Make this macro, this is the one you will actually click so put it wherever you want to access it.
Code:
#showtooltip
/click [nomod] PetActionButton1
/click [mod:shift] ActionButton1
Replace "ActionButton1" with whatever bar and button you placed the first macro (ill post the list at the bottom for those unfamiliar) and it should do exactly what the OP is looking for:
Hit the button without holding shift: pet casts his ability on your current target
Hit the button while holding shift: pet casts his ability on your focus target without changing your target (note that the pet will have to be one of the families that you put in the first macro)
As of right now there is no way that i can find to allow the button icon to dynamically update without adding a lot of "[Pet:Type] Ability" parameters after the #showtooltip, so if you want the icons, go for it, otherwise you can pick an icon and remove that line completely.
here are a list of the action button IDs for you to use in the second macro:
Code:
ActionButton# Main Bar*
MultiBarBottomLeftButton# Bottom Left Bar
MultiBarBottomRightButton# Bottom Right Bar
MultiBarRightButton# Right Bar
MultiBarLeftButton# Right Bar 2 (the "left" right bar)