Open & close iTunes every night via Apple Script

What I would like to do is have my Mac come out of sleep at 3am, open iTunes and download all my podcasts and then go back to sleep. Is this possible with Apple Script?

In System Preferences>Energy Saver click on 'Schedule' and set 'Start Up or Wake' to 3 AM
In iCal set up an event for 3.05, setting an alarm to Open File and selecting iTunes.
Suppose you want to allow half an hour:
In AppleScript Editor, write
tell application iTunes to quit
tell application "Finder" to sleep
and save it somewhere as a script, not an application.
Set up an event in iCal for 3.35 with an alarm, setting it to Run Script and selecting your script.

Similar Messages

  • Automatic graphic switch via Apple Script

    hi community,
    I would like to change the "Automatic graphics switching" (tick on / tick off) via an Apple Script. I made the following script and it works, except with line "click chckbox 2". Here it ticks the box "Show battery status in menu bar". With "click checkbox 1" it takes the "Lock-Button".
    I would be glad if anybode could tell me the right code for ticking the checkbox "automatic graphics switching" via Apple Script.
    Thanks a lot
    PS: Yes I know that tool gfx Status, but I wanna do this via Apple Script.
    tell application "System Preferences"
      activate
              set current pane to pane "com.apple.preference.energysaver"
              delay 0.5
              tell application "System Events"
                        tell process "Systemeinstellungen"
                                  tell window "Energie sparen"
      click checkbox 2
                                            delay 0.5
                                  end tell
                        end tell
              end tell
      quit
    end tell
    quit

    Hello
    You may try this. It works with MacBook Pro 2010 under 10.6.5.
    tell application "System Preferences"
        set current pane to pane id "com.apple.preference.energysaver"
    end tell
    tell application "System Events"
        tell process "System Preferences"
            tell window 1
                tell group 1 -- automatic graphics switching
                    tell checkbox 1 -- automatic graphics switching
                        click
                    end tell
                end tell
            end tell
        end tell
    end tell
    And the script below will set the option to the specified value.
    set_automatic_graphics_switching(0)
    on set_automatic_graphics_switching(i)
            integer i : status of automatic graphics switching
                0 : off (unchecked)
                1 : on    (checked)
        if i is not in {0, 1} then error "Invalid argument: " & i number 8000
        tell application "System Preferences"
            set _was_running to running
            set current pane to pane id "com.apple.preference.energysaver"
        end tell
        tell application "System Events"
            tell process "System Preferences"
                tell window 1
                    tell group 1 -- automatic graphics switching
                        tell checkbox 1 -- automatic graphics switching
                            if value ≠ i then click
                        end tell
                    end tell
                end tell
            end tell
        end tell
        if not _was_running then
            tell application "System Preferences" to quit
        end if
    end set_automatic_graphics_switching
    Hope this may help,
    H

  • Starting applications from a keynote via Apple Script?

    Is there any way to start an application from a keynote via Apple Script?

    Welcome to the forums!
    Keynote does not support the use of AppleScript in that fashion.

  • Is it possible to set a files label on opening via apple script?

    Hi,
    I would like to mark files which have been opened with i.e. a red lable.
    Would that be possible using apple script?
    If yes how would that script look like?
    Thanks in advance.

    I don;t know of anyway of doing this in Applescript. There is the ability to monitor files using launchd, WatchPaths,  but you need to know the files your monitoring before hand so it won't work for this.
    Again if the domain is limited, that is it's only a certain application or a certain folder you're interested in it might be possible to put something together in Applescript but as a general use, system wide, solution I don;t think it can be done.
    One other possibility would be to use the Finder and smart folders. You could look for all files in a certain folder or system wide that have been acessed in the past period and then mark those. Something along those lines is doable with eiter the Finder or a script.
    regards

  • ITunes store try to open closes iTunes altogether

    I recently installed iTunes on my computer and have had one GIANT problem from the beginning as soon as I open the iTunes store it tries to load and then CLOSES ITUNES ALTOGETHER!!! it's so aggrivating I was wondering if anyone could help me.

    Well I don't know exact security programs you have, but some firewalls if they see something "Reaching out" to connect on the internet that does not have permission or it sees as an intruder, will close the program altogether in order to protect the system.
    Also I don't know even if you have any antivirus programs that is causing it neither, I don't use AOL, but I know they offer some form of antivirus protection with there service.
    From what I understand so far, iTUnes works OK on your system UNTIL you try to access the itunes store, thats when the program is closed or crashes correct?

  • Hiding Folders via Apple Script

    Good evening,
    When i installed Leopard a got up a little Issue: When i look in my harddrive i can see the the folder "var,usr,etc" ... in the normal Finder Window.
    Well i thought it would be some kind of a bug so i helped myself and used a little apple script i allreade used in Tiger to hide all these annoying folders like "Microsoft Users Data etc." You know what i mean
    My Script does this:
    +set myfile to choose file+
    +tell application "System Events" to set visible of myfile to false+
    +tell application "Finder" to update myfile+
    I should be able to pick a file (have done the same for folders, too) and hide it from the normal Finder window. Well it works fine on causaul folder and data.
    But on these UNIX Folder i mentoined it wont work. My Question: How can i get this to work? (I thought of missing admin priviledges?)

    Try the instructions in this article.
    (25833)

  • HT1766 When in Itunes with my iphone connected to my computer I click on my iphone icon and itunes stops working and I have to close itunes, every thing is uptodate?

    Hi When I am in Itunes on my Windows 7 computer with my ipone connected (5s latest) it syncs OK I then click on the iphone icon and itunes stops working and I have to close down? all software is latest version? can any one help?

    Hello Dowad,
    Thank you for the details of the issue you are experiencing when connecting your iPhone to your computer.  I found an article with steps you can take if iTunes stops working when you connect your iPhone:
    iTunes: May become unresponsive when connecting iPhone, iPad, or iPod touch
    http://support.apple.com/kb/TS3219
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Change language on iTunes movie rentals via Apple TV

    We live in France and have to rent movies for our apple tvvia the French itunes, does anybody know if you can change the language on these films? like you can on bought DVDs.  Many thanks

    what do i have to do to see the movie as a whole movie?
    They are separate movies (as you stated).
    You cannot play movies consecutively as you can with music.

  • Changing background via apple script

    Hello,
    I manage a small deployment of different macintosh products and I currently have to run 5 different images so that the background images look right on all the various resolutions. I have been working on a piece of applescript to prompt the user on first startup to select their hardware type to apply the proper background image but I am running into a few issues.
    Firstly the method I am using limits me to three options and I cant seem to find any documentation on how the list function works.
    Second, I keep getting errors saying the files can't be found.
    Here is the code (with personal details removed) that I am working with
    display dialog "Choose your hardware type" buttons {"17MBP", "15MBP", "iMac21"}
    set situation to the button returned of the result
    tell application "Finder"
              set desktop picture to {"MacOSX:Users:USERNAME:Technical:Backgroundimages:" & situation & ".gif"} as alias
    end tell
    I would really like it to automatically detect the hardware type but I don't think that is possible. The error I currently get says:
    error "File MacOSX:Users:USERNAME:Technical:Backgroundimages:15MBP.gif wasn’t found." number -43 from "MacOSX:Users:eventequipment:Technical:Backgroundimages:15MBP.gif"

    Applescript panels are limited to three buttons.  if you need more than three choices, use the choose from list command:
    choose from list {"alpha", "beta", "gamma", "delta", "epsilon"}
    however, you ought to be able to gather the information you need without user interaction.  you can base a choice on machine type using code like the following:
    set machineType to paragraph 6 of (do shell script "system_profiler SPHardwareDataType")
    if machineType ends with "MacbookPro2,2" or machineType ends with "…" then
              set situation to "MBP15"
    else if machineType ends with "…" or machineType ends with "…" then
              set situation to "MBP17"
    else if machineType ends with "…" or machineType ends with "…" then
              set situation to "iMac21"
    else
      -- set default or throw error
    end if
    or it might be more convenient to base it on screen resolution using something like the following
    set displaySize to paragraph 17 of (do shell script "system_profiler SPDisplaysDataType")
    if displaySize ends with "1440 x 900" then
              set situation to "MBP15"
    else if displaySize ends with "…" or displaySize ends with "…" then
              set situation to "MBP17"
    else if displaySize ends with "…" or displaySize ends with "…" then
              set situation to "iMac21"
    else
      -- set default or throw error
    end if

  • Retrieve duration of sound files via Apple Script - System Events

    I need to get more details of my sound files into a FileMaker 10 Database as it is possible by using the FileMaker import function. There ist a complicated way by going first through iTunes and than to FileMaker. Now I found out, that part of the information displayed when pushing cmd+i can be retrieved with this:
    tell application "System Events"
    properties of file "/Volumes/MacHD/singsong.mp3"
    end tell.
    But duration, channels, bitrate are not accessible. Is this a general problem with metadata? May be if I got a hint how to retrieve meta-data from .jpg files I might be able to apply this also on .mp3

    Try the AppleScript forum under OS X Technologies.

  • Downloaded 5.01 and latest itunes. Had errors on iphone needed to restore now when i plug into itunes it freezes  I need to use task master to close.if i plug my wifes phone in no problems with itunes  took it to apple store tech no help.

    Have iphone 3g with 5.0  I downloaded 5.01 for phone and itunes latest download. Had errors on download and needed to restore. Everything came back except apps.
    Pluged into itunes and it gave me the restore screen. restored again.  Now when i plug into itunes it shows my phone but freezes up. I need to use task master to close itunes. Went to apple store tech. No help  said to use Icloud but no WiFi is available.  My wife's phone works fine with itunes.

    Basic troubleshooting steps clearly outlined in the User Guide are restart, reset, restore from backup, restore as new device.
    If you have gone through ALL the above steps and are still having problems, then you'll need to bring your phone into Apple for evaluation.

  • Using c++ variable in apple script

    Hi all,
    I am just calling the apple script from my indesign plugin.
    I need to pass the c++ variable to apple script for opening a file
    This in my apple Script which i have embedded in c++ code
    tell application "TextEdit"
    activate
    open "Users:User1:Library:Preferences:Adobe Indesign:Version 5.0:MathEQ.txt"
    end tell
    The filepath "Users:User1:Library:Preferences:Adobe Indesign:Version 5.0:MathEQ.txt" is stored in the C++ variable char* textFileName.
    I need to use the variable textFileName in apple script which has the path.
    How to go about it?
    Thanks
    Sakthi

    I have a similar problem trying to get data from any field into an AppleScript variable.
    Something like *set phoneNumber to cell "Phone Number" of current record* works fine if you are using the script from a layout that has this field on it.
    But I have a lot of fields on different layouts and I want to have access to all fields in the table, no matter what layout they are on, or what layout is currently active.
    And I want to do this without having to specify on what layout each field is located.
    In the past (FileMaker 6) I used something like *set phoneNumber to (cell "Phone Number" of current record of database 1)* but this is no longer working in FileMaker 9.
    So I was thinking to use something like *set phoneNumber to cell "Phone Number" of current record of table "Table Name"* but that doesn't seem to work.
    The only thing that seems to work is *set phoneNumber to cell "Phone Number" of current record of layout "Layout Name"* but as I said, I don't want to specify the layout for each field.
    Any ideas anyone?
    Message was edited by: khasmir

  • Apple Script to watch any network connectivity to my mac

    Hi All,
    I am looking for a apple script, when that runs it tell or display a dialog box with connection number(s) or the connected machine info or IP address or when any other machine connect to my mac then display a dialog box that someone is connected.
    is this is possible via apple script??

    You need "Little Snitch"
    I believe there's a trial version available...  It's good for like 30 days.
    A script to do what you're looking for would be really really complicated.
    http://www.obdev.at/products/littlesnitch/download.html

  • HT3702 Close itunes

    Ow do I close iTunes account

    It appears that Apple does not ordinarily allow users to close accounts, for business reasons.  If you have some special circumstances, you might have some success by directly contacting support.
    Of course, "Just stop using it" does not answer the question.

  • My Apple TV and IPad drop after x mintues from "Home Sharing". To restart it, I need to close iTunes on my Windows 7 PC, open it , then I can listen again X minutes (15-90 minutes) to my music via "Home Sharing". Any idea why? What worked for you?

    My Apple TV and IPad drop after x mintues from "Home Sharing". To restart it, I need to close iTunes on my Windows 7 PC, open it , then I can listen again X minutes (15-90 minutes) to my music via "Home Sharing". Any idea why? What worked for you?

    I believe if you updated your Apple TV, you need iTunes 11 to make it work.

Maybe you are looking for