script to cycle through multiple pdfs and want to close the windows
It worked for me. Are you sure access for assistive devices is enabled (in the accessibility preference pane)?

You could also try running tell application "System Events" to set UI elements enabled to true. Or something like removing /var/db/.AccessibilityAPIEnabled, turning the setting off and on, and restarting.