Tag Selected: how to write a script