It will always run on your active document. That isn't the same as the one that is topmost on your screen, because the topmost document doesn't necessarily have to be the one that's activated. The easiest solution is to click somewhere in your topmost window to activate it.
|