• 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: Fade Itunes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fade Itunes


  • Subject: Re: Fade Itunes
  • From: Johnny AppleScript <email@hidden>
  • Date: Mon, 20 Sep 2004 13:49:21 -0600

On 04/09/20 10:54 AM, "Ron Rosson" <email@hidden> wrote:

> Calling Applescript from Cocoa using an NSAppleScript object. Would like to
> be able to fade out a currently playing song on iTunes.

Not as pretty as it could be, but it proves the concept:

tell application "iTunes"
    set fadeStep to 10
    set currentVol to sound volume
    set newVol to currentVol
    repeat
        set newVol to newVol - fadeStep
        set sound volume to newVol
        if sound volume is 0 then exit repeat
    end repeat
    repeat
        set sv to sound volume
        if sv is less than currentVol then set newVol to newVol + fadeStep
        if newVol is greater than currentVol then set newVol to currentVol
        set sound volume to newVol + 1 -- wierd bug in iTunes 4.2 needs this
extra boost
        set sv to sound volume
        if sv is currentVol or sv is greater than currentVol then exit
repeat
    end repeat
end tell

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

This email sent to email@hidden

  • Follow-Ups:
    • Re: Fade Itunes
      • From: Michelle Steiner <email@hidden>
References: 
 >Fade Itunes (From: Ron Rosson <email@hidden>)

  • Prev by Date: Re: Fade Itunes
  • Next by Date: Re: application file id/can't find disk
  • Previous by thread: Re: Fade Itunes
  • Next by thread: Re: Fade Itunes
  • Index(es):
    • Date
    • Thread