• 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: Christopher Stone <email@hidden>
  • Date: Fri, 30 Oct 2015 08:41:20 -0500
  • X_v_e_cd: 4be3e5042168bb8bb583b17844ee332f
  • X_v_r_cd: 416b986834333b418bb50087859437cb

On Oct 30, 2015, at 08:26, <email@hidden> <email@hidden> wrote:
What I am trying to ask is, how can I resolve the problem of, a user's hard drive is called macintosh HD, yet the above code produces an error. So how do I tell the file to play on Macintosh HD?
______________________________________________________________________

Hey There,

Well – my code operates on the selected file in the Finder – so it's not going to have problems if the file is a playable sound file.

If you're playing from a fixed path on a given system you can use path to <folder-name> from the StandardAdditions.osax (available folders are listed in the StandardAdditions.osax AppleScript dictionary – viewable in the Script Editor).

set myPosixPath to POSIX path of ((path to documents folder as text) & "Library Storage:Sound Library:Sounds from the Internet:affirmative.wav")

Or you could use a home-folder-based path:

tell application "System Events" to ¬
set myPosixPath to POSIX path of disk item "~/Documents/Library Storage/Sound Library/Sounds from the Internet/affirmative.wav"

Is that what you were wanting to know?

--
Best Regards,
Chris

 _______________________________________________
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: Playing Sounds in AppleScript
  • Next 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