Sorry for the rather late reply, didn't see this post. If you are still interested in the info (or for anyone else looking at this type of thing) here's an answer:
The function you are looking for is
GetInventoryItemDurable().
you could use it in a macro like this (based on your posted, unworking macro):
|
Source code
|
1
2
|
/run _,_,InvName,_,_ = GetInventoryItemDurable("player",6)
/run if InvName == "Callous Wisdom Cape" then UseItemByName("Juggler Cape") end
|
Note that the above is untested.