AppleScript: AirPort Alarm Clock

I have been programming with Unix shell scripts for some years but following is my very first AppleScript (modified through trial and error from public domain script). This script is used together with timer application Aurora as alarm clock to stream music from iMac in living room through Airfoil utility and AirPort Express to Bose speaker in bedroom every morning. It was edited in Script Editor and saved as application. Whenever the script is invoked, I notice old Mac OS 9 style of beach ball appear on display. Obviously it has been saved as carbon instead of native cocoa application, may I know how can I turn the AppleScript into native cocoa application ? (through Script Editor / XCode ?) I have Intel version of Mac OS 10.4.9 installed on iMac Core2Duo with all Apple updates applied as of today.
I find this script rather useful for streaming any playlist to any remote speaker through Rogue Amoeba's Airfoil utility and AirPort Express. It can be kept on desktop for convenient access as well. Note Apple AirTunes bypass any audio plugins installed in iTunes (SRS iWOW and Volume Logic in my case), hence Airfoil must be used instead. Let me know whether any improvement can be made to the script.
Thanks in advance for any advice.
--Set target speaker with name of base station and playlist
set newSpeaker to "Bose"
set newList to "Party Shuffle"
tell application "Airfoil"
--Find iTunes
set pathToApp to (POSIX path of (path to application "iTunes"))
--Create a new source and set it to iTunes
set newSource to make new application source
set application file of newSource to pathToApp
--Set the source
set (current audio source) to newSource
--Set the speaker volumes
set (volume of speaker newSpeaker) to 1
--And finally start transmitting
connect to speaker newSpeaker
launch
set visible of every window to false
end tell
tell application "iTunes"
play (some track of playlist newList)
launch
set visible of every window to false
end tell
iMac Core 2 Duo 2.16GHz / 1GB RAM / 250GB HD / 20" LCD   Mac OS X (10.4.9)   Firewire RAID, AirPort Extreme/Express

Encapsulate Apple Script in "Run Apple Script" module of Automator.

Similar Messages

  • How can I turn my Mac using iTunes into an alarm clock?

    Here's my question: How can I turn my Mac, using iTunes, into an alarm clock?
    I want to be able to put my Mac to sleep but have it set up so that when it wakes up at the predetermined time iTunes will open and start playing the music I've selected....
    A "musical alarm clock"...
    A friend suggested using the Energy Saver option in Sys. Preferences to wake the computer at the right time. He said that then I could use iCal to start iTunes. I would then have to use an Apple Script to get iTunes to play the song I want.
    But is there a SIMPLER way to do this? Are there any programs out there that do this already??
    Thanks for any help....

    I recently got a copy of AlarmClock Pro from MacWorld UK. It is shareware, I think it is (USD?)19. I haven't had a chance to try it out much, but it does look quite good. I have an older version. The latest version looks even better.
    I'm sure there's plenty of freeware apps out there. You might also want to try looking here for an applescript here Doug's AppleScripts for iTunes
    p53

  • ITunes alarm clock script

    Hi,
    I'm very interested in starting AppleScript...
    My first script I'd like to do is for iTunes to start up in the morning at 07:00 and play a selected track.
    Can someone please give me a link for this and offer some tips for a newbie to AppleScript. I really want my Mac experience to grow and be more.
    And AppleScript, UNIX, and Terminal seem to be the only way to go from what I've studied thus far. Downloading things like free ware and share ware has gotten pretty blah.
    I've downloaded the AppleScript pdf and I'm ready for action!
    Thanks,
    Michael

    these books are pretty useful. (to me they are)
    http://www.oreilly.com/catalog/applescpttdg2/
    The Definitive Guide by Matt Neuburg, second edition.
    http://www.spiderworks.com/books/ashandbook.php
    Danny Goodman's AppleScript Handbook Mac OS X Edition.
    http://www.oreilly.com/catalog/applescripttmm/
    AppleScript: The Missing Manual.
    this thread could be useful.
    http://www.devdaily.com/blog/Content/2/21/566/
    the code from this application by Romeo Opena could be used as a good learning source on which to base your own alarm clock, the application it's self is pretty cool.
    http://scriptbuilders.net/files/itunesmusicalarmclock7.5.1.html
    enjoy
    Budgie

  • Is there a way that iTunes can act as a Radio Alarm Clock? I have found the radio station I enjoy listening to in the iTunes Radio List. Is there anyway iTunes (and my Mac) can be set to come-on and start playing that Radio Station from Sleep mode at spec

    Is there a way that iTunes can act as a Radio Alarm Clock?
    I have found the radio station I enjoy listening to in the iTunes Radio List. Is there anyway iTunes (and my Mac) can be set to come-on from Sleep mode and start playing that Radio Station at specific times of the day?
    Any App or plug-in that does that?
    Many thanks
    Kevin

    Turning your Mac into a clock radio.
    1.  In iTunes create a playlist that contains just the radio station you want to wake up to.
    2.  Export the playlist (as .m3u works well).  Get Info on your playlist file and look at the Open With entry to make sure it points to iTunes, VLC or some other app that will stream your station.
    3.  In iCal create an event entry at the time you want to wake up.
    4.  Right (or Control) click on your wakeup event and select Get Info.
    5.  For "alarm" select Open File.
    6.  Now under Open File there will be a place to add the file to open.  It will probably be some default entry (like iCal).  Click on it will allow you to select "other."  Then use the file dialog to select your playlist file.
    Your Mac will wake you up at the appointed time.  You don't need to keep iCal running.  If you want to put you Mac to sleep for the night then there is one more thing you need to do.  Open System Preferences to Energy Saver and click on the Schedule button.  Check Start up or wake and set the wake up time to slightly before your iCal alarm time.
    Dan

  • My iPhone 4 no longer connects to my car or alarm clock after a recent sync to my computer.  The message at I get when trying to. Connect is "this accessory is not optimized for the device" or something like that.  Anyone know how to fix this?

    My iPhone 4 no longer connects to my car or alarm clock after a recent sync to my computer.  The message at I get when trying to. Connect is "this accessory is not optimized for the device" or something like that.  Anyone know how to fix this?

    Hello there philp_69,
    If I understand correctly it sounds like your phone hasnt been recognized in iTunes on your PC since the last couple of updates. I would use the troubleshooting in the following article which will walk you through the steps one by one. 
    iPhone, iPad, or iPod touch not recognized in iTunes for Windows
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • Alarm clock not working in iOS 7 with multiple alarms set.

    I usually have two alarms set on my phone, both using the stock clock app.  One about an hour before I need to get up (so I can turn the heater on and crawl back under the covers), the other for the time I am supposed to get up.  The second alarm works just fine, but the fist one has not gone off for several days.  They are not recurring alarms because I need to change the time each day due to my work schedule.
    The phone is *usually* in a speaker dock which is plugged into the wall, and works just fine for the purpose of playing my second alarm or any of my music.  When not in the dock, it is still plugged in to the charger but uses the built in speakers.
    Has anyone else had this problem, or does anyone know of a possible fix?
    iPhone model:  iPhone 5
    iOS Version:  7.0.2 (will be updating to 7.0.3 when I return home from business on Nov. 1st)

    Use IHome Sleep. It is great!! You don't need an IHome either!!
    Download Below:
    https://itunes.apple.com/us/app/ihome+sleep-alarm-clock-app/id346249053?mt=8

  • Looking for a specific Iphone alarm clock app

    Hello,
    I have been looking on the apple store for an app that I came across a while a go. It's an alarm clock app with a calculator for morning tasks, so it will ask the user how many tasks and how long each task is going to need, and then it will calculate the total time the user need in the morning. It also has an alarm clock to wake you up according to the time calculator. If you have 5 tasks:
    brush up ---------------------------10 min
    prepare breakfast----------------10 min
    eat breakfast-----------------------5 min
    read news---------------------------5 min
    driving to school--------------------40 min
    the total time is 1 hr 10 min. Then you enter the time school starts, 8am for example. The alarm clock will wake the user up at 6:50am in the morning on that day.
    Does anyone have this app and would like to share the name of the app with me? I have been desperately looking for it and regreted not saving it to my wishlist on the first time.
    Many thanks to the apple community!!!

    1password is FREE for a limited time, and it allows you to store login info and notes(you can use as journal) and then lock the application with a passcode. And lockbox does about the same thing, it's free too.

  • Looking for a good sound dock/alarm clock for iPOD Touch 4

    I saw one other post asking about a sound dock here and out of the 3 responses, I think only the Bose was mentioned.
    I was just curious if and/or what sound dock/alarm clock combos you all would recommend? I just got a hold of the White Noise app and I would like to be able to use it through a sound dock in my bedroom as I sleep with a fan at night and the audio output on the iPOD Touch itself is not loud enough.
    I don't want to spend an arm and a leg either on a sound dock/alarm clock if at all possible.
    Thanks,
    Whiteice

    Altec Lansing. Im using the 'inMotion compact' and for its size it gives a h*ll of a punch with bass wise. As for as price goes, its reasonable.

  • Looking for an Alarm Clock app where you do math problems to turn it off

    Someone told me of an application for the iPhone that is an alarm clock in which you can use a mode that, when the alarm sounds, you need to solve a math problem or other visual test in order to cease the alarm. That way the user is more awake by the time the alarm is stopped. Sounds annoying, yes, but would be just what I need.
    Anyone know which alarm app this is? Or if it even exists?

    There's another app that got a lot of press recently called *Proactive Sleep*.
    It works similarly to the math app mentioned above but you do a 30 second visual game when you wake up. It also records your score as well as your sleep patterns and can give you recommendations and other feedback to improve your sleeping habits.

  • Help, since my update to my Iphone 4, it will no longer charge on my alarm clock docking station. The station I purchased four months ago from Target.

    It will still charge my ipod,but not my iphone. I keep getting a message on my phone when I put it on the dock, saying that it is not supported by this divise. Please help. I am not going to go out and spend another 35.00 on an alarm clock when this one works perfectly fine, my phone is just being picky. Please help.

    Talk to Toyota. The fault is in their in-car system. Talk to Toyota corporate. The dealers are clueless. Your system needs to be updated.

  • Ipod nano 2nd gen and dock/alarm clock

    i have read through alot of the posts and have not seen anything similar to my question.
    i got my daughter an ipod nano for xmas.
    we really dont leave the computer on alot and she was wanting a docking station/speaker setup. i found one that charges it/ has speakers and is also an alarm clock.
    she likes the idea of having the alarm clock with it.
    this is the model she got: curtis iMode ip210 link to where it was bought http://hhgregg.com/ProductDetail.asp?SID=0B568914D18A4CBEB2E80A95E8C46043&Produc tID=17180
    we have not hooked it up yet because of a small problem maybe. (hooked up to power that is)
    it came with a bunch of different adapters for the different ipod versions. well the nano one is incorrect. i guess due to ours being a 2nd gen version.
    the ipod goes right on the dock fine with out it.
    the little plastic adapter i got with the ipod kinda works in the slot of the radio but would need a little modification to snap in. the difference is the outside shape and would just needed some sanding. i have called the support number for the radio and all i could get from the was its not compatable. and i am not too sure why.
    from what i have found out is all the ipod dock connectors are the same and there is no difference. not sure about this just what i have noticed.
    i tried to call my local apple store and ask them but that guy started talking about firewire and problems. i told him how it docked and what it was and he still insisted on talking about firewire and those problems. i hung up as it didnt sound like he knew anything.
    so now would i be ok in useing the adapter i got with the ipod and makeing some slight mods(sanding outside edge) to it. or is the something totally different between the 1st gen and 2nd gen that would mess up the ipod if put in this unit.
    the reason i want this unit as it will replace her current alarm clock and she has a loft bed and its the only unit that we have seen that will fit and is in our price range.
    thank you for your help
    dawg
    ipod nano 2nd gen   Windows XP  

    The dock adaptor that came with the iPod is meant to fit Apple's universal dock and not a 3rd party accessory.
    The reason you are having issues is because although the dock connectors on iPods are all the same (the pins are in the same place), the connector on the second gen nano is in a slightly different place than on the first. If you look at it from the bottom with the iPod face up, it's slightly more to the left. This, and the fact that it has a metal case with rounded edges, has made the new nano incompatible with almost all these type of accessories.
    It's been mentioned here several times, and a few people have been able to get the manufacturer of the dock to supply them with an adaptor.

  • When is apple going to release a iPhone 5 alarm clock? The lack of accessories for the iPhone 5 is really making me wish I would have just kept my 4s.

    When is apple going to release a iPhone 5 alarm clock? The lack of accessories for the iPhone 5 is really making me wish I would have just kept my 4s.

    Hi - There is an alarm choice at the bottom of the clock app - is this what you are looking for?

  • WINDOWS 8.1 ALARM CLOCK DOES NOT HAVE SOUND

    WINDOWS 8.1 ALARM CLOCK/TIMER DOES NOT HAVE SOUND

    Hi:
    Works fine for me.
    The machine need to be ON for the alarm to be heard & sound/speakers needs to On & Volume turned up to audible level.
    Laptop can be in sleep mode but not powered off.
    Try right clicking on the speaker icon. This should open a window that is titled "Sound". When you select the playback tab -> it will show icons of the audio devices you have connected to your computer.
    You will need to select your stereo speaker device and then click the button "Set Default". This should enable your stereo speakers to play the sound.
    Regards
    Visruth
    ++Please click KUDOS / White thumb to say thanks
    ++Please click ACCEPT AS SOLUTION to help others, find this solution faster
    **I'm a Volunteer, I do not work for HP**

  • Nokia N8 Belle Alarm Clock Issue

    I was finally able to update my N8 to Nokia Belle a week ago and was reasonably impressed with it's attempt at an Android Froyo kind of thing, it is a step in the right direction. However-
    I set a several alarms for between 6:45 and 10am today (I'm a fairly heavy sleeper). I snoozed the first alarm by turning over the phone to give me a few more minutes of sleep. The next thing I know, my sleep is breaking and it's 9:32am! All without a sound from any of my alarms.
    I looked at my phone, and saw the box with 'Stop' and 'Snooze' on it, for the 6:45 alarm, as if it had just been activated and was waiting for me to choose either option. I pressed 'Stop' to get rid of the box and suddely similar boxes for all the other alarms started popping up in rapid succession, only then. What happened???
    I was willing to wait 6 months past the original release date because I assumed such bugs were being sorted out properly; a smartphone shouldn't still be grappling with Alarm clock bugs - it should have better things to do. I'm hoping there's a quick solution to this problem, as I cannot wait two years for the next update. Please advise!
    Also why does shuffle deactivate everytime I return to my song list? Seems silly, really - I don't want to have to keep turning it back on.

    First thing First!
    AlarmClock: Being Honest! theres no such issues with the Default Alarm app. U might hav done sumthing unusual during sleep or your app had been crashed or it might b buggy or may b sum RAM issues.
    Its not a General issue.
    I myself is a Heavy sleeper lke You!
    I too set 7 Alarms within 6:30 - 10:00 range.
    All works fine with my Nokia N8-00 Belle.
    MusicPlayer: Yeah! this had been a big problem for Music lovers that when you are Dazzling on SHUFFLE mode & once you clicked on a particular song in a list, the SHUFFLE is de-activate itself.
    It might be a problem for Some people, but Logically speaking If you are in A Shuffle mode, u should not interrupt the playlist, if you do it gets deactivate automatically.
    Nokia got a point this time
    In Love with Nokia, Symbian & N8-00

  • Battery Drain With Alarm Clock Function

    This just started happening to me last week.  I have 4 alarms set during the week days...in case I hit the 'Dismiss' button by accident. These alarms have been set since I got my phone in October. Well, last week I noticed that after the 4th alarm had gone off, my battery had gone down to 48% while still plugged into the charger.  This phone is usually on the charger all night with no problems and at 100% by the time I leave for work...until now.  Any ideas why this might be?
    I currently am recreating the issue by setting my alarms for PM and seeing if there're any changes.
    Thanks!

    I set the alarm clocks for PM.....but of course it didn't do anything abnormal. So I set them again for the AM. The next morning, my alarms went off as usual, and the battery stayed fully charged. So I am at a loss as to what was going on previously.  My only conclusion is perhaps the mini USB was not completely inside the port ????  If anything new happens I'll be sure to post.  So far the past two mornings have gone without a hitch.  Go figure!

Maybe you are looking for

  • HDMI detective vs. MDP-HDMI adapter

    I would like to get a new Mac Mini for use as a media server with my TV.  The TV wants HDMI input, but I understand Mac Minis can have problems with the HDMI sleep signal the TV may send when turned off. I know one solution to this is to use a Gefen

  • Is it possible to customize (some) of JDev features?

    Well, like - changing the default-generated files (my own custom initial web.xml, ....) - adding new items (sort of templates) in the New... dialog and so on. I did not find anything in the docs on this (my apologies if it was there, but please someo

  • Bug in Export/Import of Metadata

    I have an image (freshly imported; DNG, converted from NEF) containing the keyword "Großbritannien" which is part of the keyword-hierarchy Welt   Europa    Großbritannien The image is developed to be Black and White. To get GPS-Info into the IPTC-fie

  • Macintosh HD won't erase

    I had trouble with starting up my MacBook so had to proceed to wiping everything and starting afresh. I selected the recovery and everything, utilities, Macintosh HD etc clicked erase, and where it says erasing volume, the blue bar has moved so far A

  • Incomplete downloaded podcast marked as complete

    iTunes is downloading podcasts but not moving them from the Download folder to the Podcast folder. Yet, it is marking the podcasts as complete. I have gone thru the process of deleting the podcast, and re-downloading, but they fail at the same point.