• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            逛奔的蝸牛

            我不聰明,但我會很努力

               ::  :: 新隨筆 ::  ::  :: 管理 ::

            From: http://dougscripts.com/itunes/itinfo/icalscripts.php

            Version 1.5.1 of iCal gives you the ability to set an alarm that fires an application, a document, or...an AppleScript. Now that you can finally use your iCal as an alarm clock...uhm...how exactly can you use iCal as an iTunes alarm clock?

            Step 1: Set up iCal

            You can make any iCal Event send an alarm when it's come due. Click on "Alarm" in the Event's Info Window and select "Open File". Then, select "Other...". Navigate to a compiled AppleScript or AppleScript application (yes, compiled scripts work!) and select it. Then set the time you want the alarm to go off relative to the start time of the Event (minutes, hours, days before or after the Event is scheduled to start). I set this to "0 minutes before".

            This Event will fire "My Script1" at the "from" time of the Event

            Step 2: Control iTunes

            We'll build a little app here. The simplest thing you can do is to tell iTunes to play. Even better, to tell iTunes to play a particular playlist or radio stream. To play any playlist, use the following script substituting "Recently Played" with the name of the playlist you want to play:

            tell application "iTunes"
            	play playlist "Recently Played"
            end tell
            
            [upm] click to open in Script Editor
            

            To make sure that when you wake up you see the actual playlist, add the second line, which selects the playlist in the Source column:

            tell application "iTunes"
            	play playlist "Recently Played"
            	set view to current playlist
            end tell
            
            [upm] click to open in Script Editor
            

            Purely optional. Now, save that in Script Editor as an either "compiled" or as "application" and assign it as an alarm to an Event in iCal (read more about the differences between "compiled" and "application" AppleScripts).

            Almost forgot! If you want a really good shuffle:

            tell application "iTunes"
            	repeat 5 times
            		set shuffle to false
            		set shuffle to true
            	end repeat
            	play playlist "Recently Played"
            end tell
            
            [upm] click to open in Script Editor
            

            To play streams, copy your favorite streams into their own playlist (avoid storing streams in the main library where they get in the way; this script helps with that). Mine are in "Radio Faves". To play a particular stream, just call it by name:

            tell application "iTunes"
            	play track "Adult Pirate Radio" of playlist "Radio Faves"
            end tell
            
            [upm] click to open in Script Editor
            

            Step 3: Volume Up and Down

            Great. You can select something to play before you wake up in the morning. Now how about creating a dandy fade-up routine. First, you should know that AppleScript can set iTunes main volume from 0 to 100, off to loudest. What I do is set iTunes volume where I want it tomorrow morning. When this script is fired by iCal, it will kill the volume, start a playlist playing, and then gradually raise the volume to where I set it.

            property tick : 5 -- raise volume level by this many each loop
            property thismany : 0 -- seconds to wait before making next increment to volume
            tell application "iTunes"
            	set snd to sound volume
            	set sound volume to 0
            	play playlist "Recently Played" -- your playlist here
            	repeat
            		if (get sound volume) is greater than or equal to (snd - tick) then
            			set sound volume to snd
            			exit repeat
            		end if
            		set sound volume to (sound volume + tick)
            		delay thismany
            	end repeat
            end tell
            
            [upm] click to open in Script Editor
            

            At the end of the day, when you want iTunes to fade out and stop, schedule this:

            property tick : 5 -- change volume level by this many each loop
            property thismany : 1 -- 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
            
            [upm] click to open in Script Editor
            

            By changing the thismany and tick values, you can change the duration and dynamic of the fade. A smaller tick number will raise/lower volume in smaller increments; changing thismany changes the delay between the next change in volume. Play around with it for best results.

            There are probably better ways of doing the slow fade; it's just a matter of figuring the mathematical dynamics.

            These are just some simple ideas to get you started. Have fun! Don't over sleep!

            posted on 2009-04-07 17:20 逛奔的蝸牛 閱讀(218) 評論(0)  編輯 收藏 引用 所屬分類: Mac
            久久国产精品成人影院| 99久久精品国产一区二区| 伊人伊成久久人综合网777| 日本高清无卡码一区二区久久| 亚洲v国产v天堂a无码久久| 中文国产成人精品久久亚洲精品AⅤ无码精品| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 免费精品国产日韩热久久| 狠狠精品久久久无码中文字幕| 国产精品久久国产精品99盘| 国内精品久久久久久不卡影院| 无码人妻精品一区二区三区久久久| 婷婷综合久久中文字幕| 亚洲人成伊人成综合网久久久| 丁香久久婷婷国产午夜视频| 亚洲国产一成人久久精品| 久久精品国产欧美日韩| 97r久久精品国产99国产精| 少妇熟女久久综合网色欲| 9999国产精品欧美久久久久久| 一极黄色视频久久网站| 久久国产精品免费一区二区三区| 久久久久久久人妻无码中文字幕爆| 久久人人爽人人澡人人高潮AV| av午夜福利一片免费看久久| 久久久久青草线蕉综合超碰| 久久久久国产一区二区三区| 色综合色天天久久婷婷基地| 久久国产精品无码HDAV| 久久久一本精品99久久精品88| 久久精品综合网| 欧美精品九九99久久在观看| 青青草原综合久久大伊人导航| 狠狠色丁香久久综合婷婷| 国产成人久久精品一区二区三区| 中文成人无码精品久久久不卡 | 久久w5ww成w人免费| 人妻无码中文久久久久专区| 久久久久免费看成人影片| 久久久久AV综合网成人| 国产精品岛国久久久久|