Shellscript-in-Another-Window Exploit

Input 1/3
Simple Xss exploit that pops up an "alert" messagebox with text:

Input 2/3
Script that opens Target Window - should initialize "DestW" window where Input 3/3 will be executed.

(note:Input 3/3 will be executed after "DestW" is intialized.)

Input 3/3
Script for Another Window( opened by script in Input 2/3)