Okay this code seems to work for me. Ignore the macro name. Notice that the hot key trigger says Home, but that's because I defined my mouse button to be the Home key. You can define it to other things, including things that aren't on your keyboard, but I may have to know your mouse model to help you figure that out.
[Edit:] First, notice how there's a Click Mouse action where your mouse is currently pointed. That's because when you assign a value to a mouse button, it doesn't actually click, so we have to.
Then notice that I have a Pause 3 second action. This is typically how long it takes for me to see a new page appear when I click on something. You may choose a different value. It is possible to make this piece of code better, but that would require many lines of code and I just wanted a bare bones solution working for now.
Then notice the AppleScript action which fetches the URL of the active Safari window.
The notice the last action which logs the URL. Please notice the extra CR at the end of the action. This is important.
I think this is the gist of the problem you wanted solved. If I'm wrong, let me know.
You also wanted a macro that opened up all the URLs in the saved variable. If you need help with that, let me know.
Move or Click Mouse.kmmacros (3.1 KB)