问题
I have a Silverlight application ("file1.xap" - not ".app" it is ".xap"). How do I install and run it using AppleScript on MAC OS X?
回答1:
Besides the fact that your applet probably won't have permissions to install anything on Mac OS X 10.7 and later, you should be able to just copy the application package from any location to the applications folder:
tell application "Finder"
copy file "Your Application Name.app" of disk "Your Application Name" to the application folder of the startup disk
open file "TextEdit.app" of the application folder of the startup disk
end tell
If this doesn't work for you, then you need to explain more.
回答2:
You need to make sure that .xap file is Out-Of-Browser enabled (I suspect it is). Then instead of running the .xap file directly, open the .xap in a browser and right click it to "Install" the .xap file. Silverlight will then download a .app file that you can run on OSX.
来源:https://stackoverflow.com/questions/17757296/how-to-install-and-run-silverlight-application-through-applescript