Is it possible to open a chest through clicking on an item in the inventory?

Idea is to detect if the item is in the slot, and then open a chest if it isnt there and replace the item.
Continue to help post