retrieving information from a GUI

Hello I'm looking to make a magic system i've already made quite a few spells but i'd like to make a GUI when i shift+right click on my "magic book" item and put 5 scrolls maximum (when i right click on a scroll it sends the spell)
I'd like it to save the books I've set so that when I shift+left-click it changes book and if I right-click it sends the selected spell.

I hope that was understandable I don't have my code right now, sorry. thanks for your help

Continue to help post