1720, Scottish, "magic, enchantment" (especially in phrase to cast the glamor), a variant of Scottish gramarye "magic, enchantment, spell," said to be an alteration of English grammar (q.v.) in a specialized use of that word's medieval sense of "any sort of scholarship, especially occult learning," the latter sense attested from c. 1500 in English but said to have been more common in Medieval Latin. Popularized in English by the writings of Sir Walter Scott (1771-1832). Sense of "magical beauty, alluring charm" first recorded 1840. As that quality of attractiveness especially associated with Hollywood, high-fashion, celebrity, etc., by 1939.
Jamieson's 1825 supplement to his "Etymological Dictionary of the Scottish Language" has glamour-gift "the power of enchantment; metaph. applied to female fascination." Jamieson's original edition (1808) looked to Old Norse for the source of the word. Zoëga's Old Icelandic dictionary has glám-sýni "illusion," probably from the same root as gleam.