• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Playing Sounds in AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Playing Sounds in AppleScript


  • Subject: Re: Playing Sounds in AppleScript
  • From: Shane Stanley <email@hidden>
  • Date: Sat, 31 Oct 2015 09:41:11 +1100

On 31 Oct 2015, at 12:26 AM, email@hidden wrote:

Wen I put in something like the below, users on other machines get an
error

As Chris suggested, path to application folder will do the trick. But an alternative is to consider moving the sound file to one of the Sounds folders, like /Library/Sounds or ~/Library/Sounds, or including it within the application bundle itself (assuming you have the rights to the sound). Then you don't need to supply the path, and the code would be:

tell (current application's NSSound's soundNamed:"logo") to play()


-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

References: 
 >Playing Sounds in AppleScript (From: email@hidden)
 >Re: Playing Sounds in AppleScript (From: Shane Stanley <email@hidden>)
 >Re: Playing Sounds in AppleScript (From: email@hidden)
 >Re: Playing Sounds in AppleScript (From: Shane Stanley <email@hidden>)
 >Re: Playing Sounds in AppleScript (From: Christopher Stone <email@hidden>)
 >Re: Playing Sounds in AppleScript (From: email@hidden)

  • Prev by Date: Re: AppleScript-Users Digest, Vol 12, Issue 525
  • Previous by thread: Re: Playing Sounds in AppleScript
  • Next by thread: Re: Playing Sounds in AppleScript
  • Index(es):
    • Date
    • Thread