swift index script