Is it safe to take modafinil and escitalopram together?

Maybe. According to medscape: "modafinil will increase the level or effect of escitalopram by affecting hepatic enzyme cyp2c19 metabolism. Significant - monitor closely.".
Yes. According to www.Epocrates.Com, no significant interactions are documented but as always one needs to be careful when taking more than one medicaiton.