ICal + AppleScript

Hi guys,
Does anyone know if I can get a group of iCal events (not already in iCal) and to import them? (I am planning to integrate this into an Automator Action).
Cheers, Ricky.
www.rickyprograms.com

In Leopard, you can now address the calendar by name directly:
tell application "iCal"
set theCalendar to "MyCalendar"
set myDate to (current date)
set theDescription to "Leopard Description Text"
set theSummary to "Leopard Summary"
tell calendar theCalendar to make new event at end of events with properties {start date:myDate, summary:theSummary, description:theDescription}
end tell
Give that a try

Similar Messages

  • ICal applescript "view calendar"

    When I run the following applescript
    tell application "iCal"
    view calendar at date "Thursday, June 19, 2008 4:00:00 PM"
    end tell
    iCal moves to Thursday, but when I run
    tell application "iCal"
    view calendar at date "Thursday, June 19, 2008 5:00:00 PM"
    end tell
    it moves to Friday..
    I'm guessing it is one of the bugs relating to the timezone management within iCal? (I'm in California)
    Is it just me and my computer or is this actually a bug?

    Is it just me and my computer
    No. Click here and fill out the form.
    (33000)

  • ICal - AppleScript To Convert ToDos To Events

    I use a iMac G4 800MHz 15" running 10.4.11. I have used Chronos Personal Organizer 4.5.0 for quite some time. I want to transfer my approximately 21,000 CPO calendar items (all are To Dos) to iCal. This number includes approximately 5,000 items that I transferred from DateBook Pro to CPO a few years ago.
    I downloaded the trial version of Chronos SOHO Organizer 6.5.4 and the accompanying converter. I converted my three CPO calendars and then imported them to SOHOO 6.5.4 successfully. Then, I exported each of them from SOHOO 6.5.4 as a ".ics" file. I imported each of these ".ics" files into iCal successfully. However, iCal does not display To Do items embedded in the calendar as does CPO and SOHOO. iCal segregates the To Do items into the To Do list window. Therefore, I wish to convert all of my 21,000 iCal calendar items from To Do items to Events, such that iCal will display them in the calendar display (day / week / month) on the original date that I assigned to each of them. During the conversion from To Do to Event, I wish to retain all text / remarks / notes.
    Can anyone suggest an AppleScript that will perform this conversion? I have searched the web exhaustively without any success. Would anyone like to take a stab at writing an AppleScript that performs this conversion? I have read many postings on various forums that wish to do the same thing as me, eg. transfer data from either CPO or SOHOO to iCal but embed the To Do items in the Event calendar.
    Thank you.
    Kurt R. Todoroff

    This is relatively straightforward, but you should be aware of a couple of issues:
    A Task, "To Do" in iCal, has no duration and iCal does not seem to parse SOHOO's DUE parameter correctly so it cannot have a time or alarm either.
    If you are prepared to have your tasks appear on their original days within iCal, this can be done, but you would either need to choose to have them appear as all day events or events of a fixed duration (e.g. none) and at a fixed time (e.g. 9am).
    You could try this (which is the allday event version):
    Make a new calendar in iCal called "Test"
    Import your .ics file - choosing to add the events to the Test calendar.
    Copy and paste the text between the lines (below) into Script Editor and press Run
    If you're happy with the result, simply rename your Test calendar.
    If not, or I have misunderstood what you want to do, post back.
    Good luck, and _*make sure you have taken backups before starting*_.
    tell application "iCal"
    repeat with calNum from 1 to (count of calendars)
    if name of calendar calNum is "Test" then
    exit repeat
    end if
    end repeat
    set todoList to todos of calendar calNum
    repeat with theTodo in todoList
    set dueDate to due date of theTodo
    set theSummary to summary of theTodo
    set theDescription to description of theTodo
    try
    set dummy to length of (theDescription)
    on error
    set theDescription to ""
    end try
    try
    set makeEvent to (make new event at the end of events of calendar calNum with properties ¬
    {start date:dueDate, end date:dueDate, summary:theSummary, description:theDescription, allday event:true})
    delete theTodo
    on error
    loop
    end try
    end repeat
    end tell
    -------------

  • Ical Applescript questions and missing commands

    This is an advanced itunes question....
    I am using itunes with ical and applescript to run a radio station.   I have used alot of things from Doug Adam's and taken some things past where i can get help.   I am using itunes 7...and os X 10.5.8 .   i am also using ical buddy, gcal(for xml) and a few other neat little tricks.  
    I have run into a few technical problems and was wondering if anyone knew how to fix them.
    1 Problems happen:    is there a way to disable ALL pop-up warnings in itunes........not just sync, or playlist warnings, but all errors that require someone to click......
    2 is there a way to Toggle (on/off) itunes soundcheck in the preferences when you set a playlist to play with an applescript
    Thank you,
    Jacob Bouchard
    www.wfku.org

    I  have updated to Itunes 10.4, and have encountered a whole new set of problems
    1. (solved)  the popup warnings in Itunes 10.4 are gone.   I have a good backup applescript that forcequits the applescript app, or forces a return Key press into the warning window.   It works but i want to make it better
    2. (solved)   I have solved the soundcheck problem with an applescript (its not pretty, but does the job)
    NEW PROBLEM:
    upgrading to Itunes 10.4 removed the *Smart shuffle features that were in Itunes 7.6.   (this is much different from smart playlists)  
    I NEED THAT FEATURE
    Can someone at apple please give me the Hexidecimal code  i need to replace in the com.apple.itunes prefs file that will re-orient the smart-shuffle  to *shuffle "Songs"  with "least likely artist repeat" Setting
    Thanks in Advance,
    Jacob
    *Removed in iTunes 8
    also as a sidenote iCal version 4.04 is doing something shady when i export the event information.   It feeds garbage into my code which creates errors apparently at random.   The problem is resolved with earlier and later releases of iCal (That i cannot use becuase i have a Macbook pro 2006 Intel Duo core which will not take the lion operation system)   Sometimes it feeds garbage after the ical information that my shellscript is requesting

  • ICal AppleScript translation to Snow Leopard

    (I didn't see an AppleScript section, so if this is posted in the wrong section, I apologize.)
    I use Event2ToDo (an AppleScript function) to create ToDos in iCal on a daily basis. It is a very helpful tool, and I really want to keep using it. That being said, under Snow Leopard it doesn't work anymore. Specifically, the line that gets the error is...
    +tell application "iCal" to set convertMePosList to uid of (every event in thisCal *whose open file alarms is not {}* and start date is less than or equal to (current date))+
    And it says...
    +error "iCal got an error: Can’t make {} into type open file alarm." number -1700 from {} to open file alarm+
    I think, from what I could discern, it's trying to say "whose open file alarms is not blank." Does anyone know how to fix this to work under Snow Leopard?

    Hi Alexander,
    I believe the author of Event2ToDo is contactable via his website. <http://www.sharmanshelving.com.au/webmaster/me/>
    I don't have Snow Leopard yet, but I'd try changing the line to the following:
    tell application "iCal" to set convertMePosList to uid of (every event in thisCal whose open file alarms is not equal to missing value and start date is less than or equal to (current date))
    Best wishes
    John M

  • ICal applescript: get current event?

    I am trying to use Applescript alarms from iCal to do a couple things: first, I want it to set my away message in iChat to the event that called the alarm, and second, I was to be able to send an e-mail (really a text message) containing the event. I would settle for just being able to get the closest event to "now", but that is the last resort. Is there any way to get the ID of the event that called the applescript in the first place? Barring that, how can I get the closest event to "now"? The code I have seems to miss recurring events (I am comparing start time to now, but start time on recurring events was the first occurrence).

    I am trying to use Applescript alarms from iCal to do a couple things: first, I want it to set my away message in iChat to the event that called the alarm, and second, I was to be able to send an e-mail (really a text message) containing the event. I would settle for just being able to get the closest event to "now", but that is the last resort. Is there any way to get the ID of the event that called the applescript in the first place? Barring that, how can I get the closest event to "now"? The code I have seems to miss recurring events (I am comparing start time to now, but start time on recurring events was the first occurrence).

  • GTD iCal Applescripting Idea

    Hi,
    Is there any possible way to make an Applescript that automatically copies your To-Do items and then creates an All-Day event for each of them? This is really handy for viewing To-Do items with due dates from an iPod's interface.
    I use Actiontastic to export all of my to-do items to my iCal, but the best possible way to view the To-Do items of the day on the go is through my iPod's Calendar interface. Viewing to-do items ordinarily (through to-do list in calendars) sorts them alphabetically, and I HAVE to view them by date in order to know when to accomplish things.
    Thanks,
    Harrison

    John,
    Thanks...in the global set commands, I was declaring the color as:
    set calendarColor to "{26214, 65535, 52428}"
    instead of
    set calendarColor to {26214, 65535, 52428}
    Removing the quotes makes a huge difference!
    Thanks,
    j
    Many different systems...   Mac OS X (10.4.8)  
    Many different systems...   Mac OS X (10.4.8)  

  • TS4337 Ical/applescript/animator can a customised event with added fields be generated?

    Yet again i find myself trawling the Internet to find the best solution to my quest.
    I run my own business and share jobs with a select amount of people through iCal on our iphone's ipad's and Macbooks as do my associate's. Currently we use the generic event that is created in iCal but most of our information has to go into note's at the bottom of the event, which frankly is a pain in the ****. Why Apple with the million's of $$$ in cash they seem to have in the bank haven't given the billions of loyal customer's the freedom to create their own fully customisable event's is beyond me, anyway back to the propblem.
    What if any is the best way to approach this problem and giving us a solution?
    Do we use a third party software like Bento 4 or Filemaker Pro?
    Do we use Applecript or Animator or Both?
    we are not looking to set up a database, once every six months I backup my calandar to Excel and that is it.
    Any suggestions would be appriciated. Many Thanks in advance.

    Hi Trinidad,
    Putting the additaional columns in the table will result in me storing redundant info in the specific table.
    The values are already stored in other related tables and I'd just like to display them as additional info fields.
    .Ben

  • Printing iCal events in order

    The Apple-provided iCal Applescript, Create Event Summary, has an issue: (when printing the events of this month) it does not print the events in date-time order, but jumbles that order. How is that Ascript determining the order it does show, and how can I change that to the date-time order? (Using iCal 2.0.3)

    Thanks, however I think the iCal list print includes
    all dates whether they have any events or not. My
    You can specify time range for printing, to print weekly events you specify:
    Starts on date: mm/dd/yy
    Ends after: 7 days
    purpose here is to print a schedule of weekly events
    without the extraneous dates. I think the script is
    supposed to address this shortcoming of iCal print
    view. I've edited the script so I can specify any
    period, such as 120 days. I just can't spot the place
    in the script where the order of printing events is
    determined. For that matter, when I'm feeling
    ambitious, I have a notion of printing the events as
    rows in a table-like format-- is that possible?
    It's quite complicated, especially for repeated events. se this thread:
    http://discussions.apple.com/thread.jspa?threadID=440481&tstart=0

  • Third-party Applications Responding to an iCal Alarm Twice

    This issue involves multiple products so I apologize ahead of time if I have put this in the wrong topic or site and would appreciate any suggestions as to whether or not I should refer to the developers of the third-party apps involved.
    As an enthusiastic user of my MacBook, I like to have it configured to turn itself on, play music (which happens to be in the .flac format, so I use VLC), and open some daily-used applications and webpages (mostly on Firefox, my web browser of choice, and a couple on Safari to take advantage of Growl support for RSS feeds and better Flash performance) in the morning via the Energy Saver preference pane and an iCal AppleScript alarm.
    The only problem I've been having is that whenever iCal runs this script, I wake up to see to see that VLC and Firefox have opened the intended files/webpages twice. Everything works absolutely fine when the same script is saved as an application and launched as such by an "open file" alarm, so this bug ultimately has no effect on its usability but I'm just curious about what's going on.
    Any idea about what may be causing this behavior? Thanks in advanced!

    Welcome Viewer07,
    That's new to me.
    But I guess that you ask two times to open.
    Maybe try a delay?
    Good luck!

  • Hours listed in Weekly View

    When I open in Weekly View, it starts at 1:00am. I have already gone into preferences and selected for my day to start at 7:00am but it only shades from 7:00am on. I do not want to see 1:00am to 6:00am as I will never have any appts then. How do I make it start showing the times at 7:00am?

    ginagd,
    Welcome to Apple Discussions.
    This Visible Day in iCal AppleScript by John Maisey, may be helpful.
    ;~)

  • Auto recording from Radio

    Is it possible to set up my iBook to automatcially record a Real Player stream at a set time?
    I have Real Player and Audio Hijack Pro on my system and wondered if I could set Automater to load the programs and record then switch off when finished?

    Keith,
    There is a lot of flexibility offered through iCal, AppleScript, Automator, Audio Hijack Pro, Power Manager
    (http://www.dssw.co.uk/powermanager/).
    To directly answer your quiry about shut-down. That can be handled by an AppleScript.
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">tell application "System Events"
    shut down
    end tell</pre>
    or if you want to just put the machine to sleep just replace the "shut down" in the AppleScript with a "sleep" command.
    However, how do you get this AppleScript to run after the Audio Hijack Pro session?
    This is where it gets interesting. Depending on your needs you could:
    1) include both the Audio Hijack session and the shut down AppleScript in an AppleScript/Automator action so that it would be called immediately after your recording session;
    2) Have an iCal event call the shut down AppleScript/Automator action;
    3) What happens if your computer is off when the recording timer is expected to run? With OSX you also have the ability to start-up and shut-down at set times. Press the Schedule button under the Energy Saver Panel of System Preferences. However you will notice that there is only one start-up and one shut-down time available.
    4) If you have multiple sessions or they occur at inconvenient times i.e. 2 AM, you might want to check out Power Manager which gives you the capability to start-up and shut-down the computer at multiple times.
    PowerBook 12"   Mac OS X (10.4.6)  

  • Missed scheduled jobs in launchd

    I have an iCal Applescript which I want launchd to run, but there seems to be an issue with the scheduling. In a nutshell, I want to run a script at 5PM (or anytime after 5PM when I log in). Using Lingon, I made a script to do that, but the only problem is that the script will only run if my account is logged in at 5PM. If I log in after 5PM, the script will not run at all (I expected it to run immediately after launch). Is there a fix to this? I thought Leopard ran jobs that missed there scheduled time (unlike Tiger). I do not want to schedule an alarm in iCal. The plist file is below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>com.apple.iCal.UpdateCalendars</string>
    <key>ProgramArguments</key>
    <array>
    <string>osascript</string>
    <string>/Library/Scripts/iCal/UpdateCalendar.scpt</string>
    </array>
    <key>QueueDirectories</key>
    <array/>
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>17</integer>
    <key>Minute</key>
    <integer>0</integer>
    </dict>
    <key>WatchPaths</key>
    <array/>
    </dict>
    </plist>

    I also thought that launchd runs jobs the first chance it gets after scheduled time. maybe it doesn't work with user launch daemons. try saving it as users agent or users daemon in lingon. I know for sure that system periodic jobs from /System/Library/Luanchdaemons do run the first chance they have if they miss the scheduled time. for example com.apple.periodic.daily does that.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>com.apple.periodic-daily</string>
    <key>LowPriorityIO</key>
    <true/>
    <key>Nice</key>
    <integer>1</integer>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/sbin/periodic</string>
    <string>daily</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>5</integer>
    <key>Minute</key>
    <integer>15</integer>
    </dict>
    </dict>
    </plist>

  • Daily printing scheduling?

    Is there a good way to set iCal up to print my daily schedule/to-dos in the morning before I leave for class/work?
    I tried looking into Automator or Apple Script, but I don't know them well enough. I imagine it would involve using cron to schedule an Apple Script to open iCal and print the day's items, but any insight or simpler way would be much appreciated. Thanks.

    Hi Scott,
    This Applescript does it on my system. Copy the blue text into a Script Editor window (Applications> Applescript> Script Editor), press Run to test the script. If you like it save it as a script.
    You could then use iCal to run the script every morning. Make a new calendar, make a repeating event and add a run script alarm to the event that opens the script, hide the calendar.
    -- Print Today's iCal
    -- Applescript -- John Maisey 9 October 2006
    -- www.nhoj.co.uk
    tell application "iCal"
    view calendar at (my (current date))
    switch view to day view
    activate
    tell application "System Events"
    keystroke "p" using command down
    delay 1 -- (seconds) Edit this delay if needed.
    keystroke return
    delay 2 -- (seconds) Edit this delay if needed.
    keystroke return
    end tell
    quit -- Or perhaps not?
    end tell
    Best wishes
    John M

  • Applescript to suck ical dates into iweb

    I was referred to this forum from the iweb forum (http://discussions.apple.com/thread.jspa?threadID=2513935&tstart=0).
    Here's what I would like to do: I am an athletic director and would I have entered all of my school's athletic contests into iCal. I would like to set up something in which iWeb can pull the events out of iCal (I have mobileme) into a "week at a glance" type of display on our athletics page (made with iweb). Ideally it would automatically update so that as events are completed, the next events would show up. I don't want to embed a calendar.
    I want something that looks like the table on the right of this page: www.twu.ca/athletics.
    Is there an applescript that could help me pull dates from iCal into a text box in iWeb?

    Hi,
    You may be able do this with an Applescript. However there is not enough information supplied to know.
    How are ther events formatted in iCal? Do they contain the full name of the person? Do they say how old they are? Are the people already in Address Book, or would they all be new cards?
    Best wishes
    John M

Maybe you are looking for

  • Updated to itunes 9:  now Airtunes won't connect,

    I unfortunately do not recall the last version of itunes I had.... it wasn't very old though. The only reason I updated to 9 last night was the itunes store forced me to in order to get a new episode. Anyways... after the update, upon starting iTunes

  • Animation preset crashing cs5.52

    It seems that every time I use an ADOBE PREMIERE PRO animation preset, it's impossible to reopen the saved file once the program it has been closed. Eventually the program itself crashes and asks to be relaunched. Any known issues? Thanks for help in

  • My apple tv will not update or restore, anybody else have this problem

    having trouble updating apple tv, Help

  • English language exchange! Culture! Conversation! All welcome!

    Hi! My name is Alli. I'm 19 years old and from the United States. I love learning of different cultures around the world and building friendships. I speak English and would love to learn a bit of ANY language I'm exposed to. Totally willing to help y

  • Documaker 10.3 vs 11.3

    Hi everyone, We are seriously considering to propose upgrade to our current Documaker 10.3 to 11.3. I am sure there will be a lot of improvements to the 11.3 version. I am not able to find much information about the key differences between both the v