write script