writing script database