Sie möchten testen, ob nicht ausgeführt wird
set appname to “Applications/Cubase 5.app” tell application appname to launch repeat until application appname is not running delay 1 end repeat if application appname is running then do shell script "sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist" password "YOUR_PASSWORD" with administrator privileges end if activate appname