Updated code for Xcode 6 Beta 6, but the Beta is broken

There’s currently a bug in casting AnyObject to String, so the script doesn’t work right now.