Re: Playing Sounds in AppleScript
Re: Playing Sounds in AppleScript
- Subject: Re: Playing Sounds in AppleScript
- From: Shane Stanley <email@hidden>
- Date: Fri, 30 Oct 2015 22:52:12 +1100
On 30 Oct 2015, at 10:29 PM, email@hidden wrote:
I wanted to see if there was a possibility of playing sounds in my scripts?
I think you mentioned in another message that you're running 10.11 or 10.10, so you can use this:
-- at top of script use scripting additions use framework "Foundation" use framework "AppKit"
-- where you want to play the sound set theFile to POSIX path of "Path:to:sound:file.mp3" set theSound to current application's NSSound's alloc()'s initWithContentsOfFile:theFile byReference:false tell theSound to play()
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden