James became obsessed with the threat posed by witches and wrote Daemonologie in 1597 , a tract inspired by his personal involvement that opposed the practice of witchcraft and that provided background material for Shakespeare 's Tragedy of Macbeth . ; .
The threat posed by witches was a concern for James VI and I .