# Start script on open blender file

I have written up a script for my model. But there is a bit of a problem with it. As in I have to run the script every time I open the file. I want the script to run automatically when I open the blender File.

There are two things you need to do -

1. Setup the script in blenders text editor. The name of the text block needs to end with .py and the register checkbox needs to be enabled.

1. Ensure that Auto-Run Python Scripts is enabled in your preferences.

• Hello. I am looking for a universal solution that is not as part of the blender file. Is there an "autostart.py" type of file that Blender runs when it opens? Dec 28, 2017 at 9:44
• You should ask that as a question, with a bit more info on what you want to achieve. Without modifying blender itself, I think an addon should be able to do what you want, it can setup bpy.app.handlers. Dec 29, 2017 at 1:02
• For anyone wondering, if someone opens the .blend file and they have the autorun option turned off, it won't just silently fail; it will display a prompt asking the user if it's okay to run the script. May 2, 2021 at 1:33

In blender 2.8x it's the same things to do :

1. rename your script file in the text editor with .py at the end
2. check register in the Text menu (this option is greyed out until you rename your file)