Currently Being ModeratedJun 5, 2013 7:16 AM (in response to John Antolino)
I am pretty sure it's just because you are not escaping the path.
The AppleScript version should read:
do shell script "sudo mdutil -i on //" with administrator privileges
I think, by the way, that having sudo and the 'with administrator privileges' is probably tautological - you really only need one or the other in my opinion.
Currently Being ModeratedJun 5, 2013 7:48 AM (in response to John Antolino)
do shell script "sudo mdutil -i on /" with administrator privileges
Never, ever, ever use 'sudo' within 'do shell script'.
At one level, sudo expects to prompt the user for authentication. You can't do that within 'do shell script'.
If you need elevated privileges that's what '... with administrator privileges' is for.
All of your commands should work if you remove the 'sudo'.