Wait for more elements instead of arbitrary sleeps in add_target.applescript