• 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: Can't play sound more than once
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't play sound more than once


  • Subject: Re: Can't play sound more than once
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 25 May 2017 22:15:29 -0500

On 05/25/2017, at 21:46, Brian Christmas <email@hidden> wrote:
Using Shane’s manual, I’m  trying to play a ‘glass’ sound. Trouble is, I’ve spent threee houts trying all sorts of coding to get it  to play three times in sucesssion, without being able to get it to play more than once.


Hey Brian,

Yes, that's a bit tricky.

--
Take Care,
Chris

------------------------------------------------------------------------------
# Auth: Christopher Stone { Heavy Lifting by Shane Stanley }
# dCre: 2016/10/10 16:45
# dMod: 2016/10/10 16:45 
# Appl: AppleScriptObjC
# Task: Play Sound
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Play, @Sound, @Glass
------------------------------------------------------------------------------
use framework "Foundation"
use scripting additions
------------------------------------------------------------------------------

repeat 3 times
playGlass()
end repeat

------------------------------------------------------------------------------
--» HANDLERS
------------------------------------------------------------------------------
on playGlass()
set glassSound to current application's NSSound's soundNamed:"Glass"
tell glassSound
its |stop|()
set soundDuration to its duration()
its play()
end tell
current application's NSThread's sleepForTimeInterval:soundDuration
end playGlass
------------------------------------------------------------------------------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Can't play sound more than once
      • From: Brian Christmas <email@hidden>
  • Next by Date: Re: Can't play sound more than once
  • Next by thread: Re: Can't play sound more than once
  • Index(es):
    • Date
    • Thread