View unanswered posts | View active topics It is currently Sun Apr 20, 2014 6:24 pm



Reply to topic  [ 5 posts ] 
 iTunes Fade 
Author Message
User avatar

Joined: Jun 04, 2008
Posts: 178
Location: Las Vegas, NV
Post iTunes Fade
I use this script when putting the house to sleep at night, if music is playing it will gradually fade out over time, then stop iTunes and reset the volume to your regular level.

Stole most of it from Doug's AppleScripts: http://dougscripts.com/itunes/

-------

property tick : 1 -- change volume level by this many each loop
property thismany : 30 -- seconds to wait before making next change to volume
tell application "iTunes"
    repeat
        set snd to sound volume
        if snd is less than or equal to tick then
            set sound volume to 0
            exit repeat
        end if
        set sound volume to (snd - tick)
        delay thismany
    end repeat
    stop
end tell

tell application "iTunes"
    stop
    set snd to sound volume
    set sound volume to 40
end tell


Thu Feb 10, 2011 12:07 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 8356
Location: Austin, Texas
Post Re: iTunes Fade
You'll want to make sure you run it as an external script - if it's embedded it'll hang up the server until it's finished running. Cool script, thanks!

_________________
Jay (Indigo Support)
Image


Thu Feb 10, 2011 2:39 pm
Profile WWW
User avatar

Joined: Jun 04, 2008
Posts: 178
Location: Las Vegas, NV
Post Re: iTunes Fade
jay wrote:You'll want to make sure you run it as an external script - if it's embedded it'll hang up the server until it's finished running.


Never thought of that! and of course trying to compile it in script editor give me errors.. :?:

Any applescript experts have any suggestions why I am getting this error in script editor and not when its compiled in Indigo as an embedded script?

Thanks!


Attachments:
Screen shot 2011-02-11 at 10.32.49 AM.png
Screen shot 2011-02-11 at 10.32.49 AM.png [ 70.9 KiB | Viewed 1408 times ]
Fri Feb 11, 2011 10:38 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 8356
Location: Austin, Texas
Post Re: iTunes Fade
From what I can see, it looks like your copy/paste didn't quite work - this line seems to be missing:

Code: Select all
if snd is less than or equal to tick then

_________________
Jay (Indigo Support)
Image


Fri Feb 11, 2011 11:02 am
Profile WWW
User avatar

Joined: Jun 04, 2008
Posts: 178
Location: Las Vegas, NV
Post Re: iTunes Fade
jay wrote:From what I can see, it looks like your copy/paste didn't quite work - this line seems to be missing:

Code: Select all
if snd is less than or equal to tick then



Boy do I feel dumb, :oops: Thanks Jay!


Fri Feb 11, 2011 12:34 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.