Actually, it goes something like this:
Let "X" mean something of which nothing greater can be imagined. No matter what we can imagine, X is greater than what we can imagine and nothing is greater than X.
Let's imagine an apple. Sweet and juicy, or tart and dry, easy to bite into or hard to bite into--however you like your apple, imagine that. If that imagined apple coincides with a real apple then we have imagined something greater than just the apple we imagined. We have imagined (in this scenario) that the apple is real. Imaginings are composed of things we've encountered in past experience. We have tasted apples that are sweet and apples that are tart, so we can imagine them. And, in imagination, we can compose things that we have experienced to make things we know are not real (unicorn = horse + tusk, and a thing greater than "in the mind" = thing "in the mind" + reality).
But what would be greater than imagining that the apple exists? Well, that would be the apple actually existing apart from our imagining, i.e. objectively.
If X exists only as we imagine X to be, then we can imagine something that is greater than X, we can imagine that X is in reality just as we imagined X to be. But we have defined X as something of which nothing greater can be imagined.
In imagining X is real we have imagined something greater than X. The only thing that is greater than our imagining that X is real is X actually being real.
Based on the premise of our definition of X, X must exist.
Anselm's proof is not that a god exists, but that anything defined this way must exist.