MH/OH weapon swap macro for ambush?

I've googled a bit and only found macros that would let me swap my weapons with weapons in my bags, but I just want to swap my current MH to my OH and then back again, is that possible?
/script PickupInventoryItem(17); PickupInventoryItem(16);
/script local a,b=CursorHasItem,PickupInventoryItem;if(not a())then CloseMerchant();b(17);if(a())then b(16);end end