How to Solve NameError: name 'tell' is not defined -- applescript
Solution: Import the 'tell' module
To Solve the error, add the following line to the top of your code.
from applescript import tell
For more information:
Python applescript tell