@haizhou you'll want to take a look at [Chef's docs on notifications for resources](http://docs.opscode.com/chef/resources.html#notifications), which describes the `notify` and `subscribes` mechanisms.

I'd encourage, perhaps, that either the directory creation notifies the script creation, or the script creation subscribes to the directory creation.