Re: Fade Itunes
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
References: | |
| >Fade Itunes (From: Ron Rosson <email@hidden>) |