[[ Cocoa ]] Refactored script environment.