Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Import Excel Schedules to iCal

Can I import my schedules that we keep in Excel into iCal?

Hope this is something simple.

Mac Book Pro, Mac OS X (10.6.1)

Posted on Nov 7, 2009 5:23 AM

Reply
Question marked as Best reply

Posted on Nov 7, 2009 3:27 PM

If you make a comma-separated values file, you can use an Applescript such as the sample below to import them.

User uploaded fileAK

<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">--Convert CSV file to iCal events
--Prompts for file, then processes
--expects date,start time,end time,event name,xxxx,calendar name
--eg 12/01/2006,20:30,22:00,Water Committee,,TestCal
--change the various text item ns if data order in a file line is different
--blank lines skipped
--if other data present (eg location, notes ...) add a line in the tell calendar Calno loop
--to include it eg set location to text item 5 of ThisLine
set OldDelimiters to AppleScript's text item delimiters
set LF to ASCII character 10
set theFile to choose file with prompt "Select CSV calendar file"
set theLines to read theFile
set AppleScript's text item delimiters to {LF}
set theLines to paragraphs of theLines
set AppleScript's text item delimiters to {","}
repeat with ThisLine in theLines
if (count of ThisLine) > 0 then --ignore blanks
set StartDate to date (text item 1 of ThisLine & " " & text item 2 of ThisLine)
set EndDate to date (text item 1 of ThisLine & " " & text item 3 of ThisLine)
set CalName to word 1 of text item 6 of ThisLine
tell application "iCal"
set CalList to title of every calendar
if CalName is in CalList then
repeat with CalNo from 1 to count of CalList
if CalName is item CalNo of CalList then exit repeat
end repeat
else
set NewOne to make new calendar at end of calendars with properties {title:CalName}
set CalNo to 1 + (count of CalList)
end if
tell calendar CalNo
set newItem to make new event at end of events with properties {start date:StartDate}
set summary of newItem to text item 4 of ThisLine
set end date of newItem to EndDate
end tell --calendar
end tell --iCal
end if
end repeat
set AppleScript's text item delimiters to OldDelimiters</pre>
15 replies
Question marked as Best reply

Nov 7, 2009 3:27 PM in response to Fred Davenport

If you make a comma-separated values file, you can use an Applescript such as the sample below to import them.

User uploaded fileAK

<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">--Convert CSV file to iCal events
--Prompts for file, then processes
--expects date,start time,end time,event name,xxxx,calendar name
--eg 12/01/2006,20:30,22:00,Water Committee,,TestCal
--change the various text item ns if data order in a file line is different
--blank lines skipped
--if other data present (eg location, notes ...) add a line in the tell calendar Calno loop
--to include it eg set location to text item 5 of ThisLine
set OldDelimiters to AppleScript's text item delimiters
set LF to ASCII character 10
set theFile to choose file with prompt "Select CSV calendar file"
set theLines to read theFile
set AppleScript's text item delimiters to {LF}
set theLines to paragraphs of theLines
set AppleScript's text item delimiters to {","}
repeat with ThisLine in theLines
if (count of ThisLine) > 0 then --ignore blanks
set StartDate to date (text item 1 of ThisLine & " " & text item 2 of ThisLine)
set EndDate to date (text item 1 of ThisLine & " " & text item 3 of ThisLine)
set CalName to word 1 of text item 6 of ThisLine
tell application "iCal"
set CalList to title of every calendar
if CalName is in CalList then
repeat with CalNo from 1 to count of CalList
if CalName is item CalNo of CalList then exit repeat
end repeat
else
set NewOne to make new calendar at end of calendars with properties {title:CalName}
set CalNo to 1 + (count of CalList)
end if
tell calendar CalNo
set newItem to make new event at end of events with properties {start date:StartDate}
set summary of newItem to text item 4 of ThisLine
set end date of newItem to EndDate
end tell --calendar
end tell --iCal
end if
end repeat
set AppleScript's text item delimiters to OldDelimiters</pre>

Nov 8, 2009 4:26 AM in response to Austin Kinsella1

Thx AK,

Looks like the answer is NO. That is too bad.

Your work-a-round script is a little too much for me. Have also thought scripts are band-aids for bad software.

Incredible that iCal does not allow simple importing from Excel, text and comma files.

I currently export my spreadsheet as a text/tab delimited file, then import to Palm software, export as a vcal file, then import to iCal.

Was hoping that iCal would finally have a simple import from text and comma files.

Oh well, thanks much for your help.

Nov 8, 2009 10:08 AM in response to Fred Davenport

You could use the script with tab-delimited files by changing

set AppleScript's text item delimiters to {","}


to

set AppleScript's text item delimiters to {tab}


and save yourself a couple of steps.

Have also thought scripts are band-aids for bad software

We have a philosophical difference here - I prefer my software to be minimalistic in features but easy to integrate into a workflow or expand.

User uploaded fileAK

Dec 29, 2009 1:52 PM in response to Fred Davenport

**** All!
I have been trying to do this for a while!! Using the script above, for the first time, i was able to import events from excel to ical.

One question for John would be "How can I add location to events that are created?" The current script created the events, start and finish time as well as the event name into the appropriate calendar but seemed to skip over the location.

Thanks a lot for making my life dramatically easier.

Dec 29, 2009 4:43 PM in response to Austin Kinsella1

Sorry AK

Gave credit to John. He had something similar on another thread. Your script worked great. Was able to modify the script to add location. THANKS a lot!! This is Awesome.

This is what the script looks like:


set OldDelimiters to AppleScript's text item delimiters
set LF to ASCII character 10
set theFile to choose file with prompt "Select CSV calendar file"
set theLines to read theFile
set AppleScript's text item delimiters to {LF}
set theLines to paragraphs of theLines
set AppleScript's text item delimiters to {","}
repeat with ThisLine in theLines
if (count of ThisLine) > 0 then --ignore blanks
set StartDate to date (text item 1 of ThisLine & " " & text item 2 of ThisLine)
set EndDate to date (text item 1 of ThisLine & " " & text item 3 of ThisLine)
set CalName to word 1 of text item 6 of ThisLine
tell application "iCal"
set CalList to title of every calendar
if CalName is in CalList then
repeat with CalNo from 1 to count of CalList
if CalName is item CalNo of CalList then exit repeat
end repeat
else
set NewOne to make new calendar at end of calendars with properties {title:CalName}
set CalNo to 1 + (count of CalList)
end if
tell calendar CalNo
set newItem to make new event at end of events with properties {start date:StartDate}
set summary of newItem to text item 4 of ThisLine
set location of newItem to text item 5 of ThisLine
set end date of newItem to EndDate
end tell --calendar
end tell --iCal
end if
end repeat
set AppleScript's text item delimiters to OldDelimiters

Excellent!!

Feb 14, 2010 10:34 PM in response to Fred Davenport

You can save it as a csv file that can be imported to Google Calendar. From there, you can add your google account in ical.

Directions to properly format the csv file in excel are provided by Google:

https://www.google.com/support/calendar/bin/answer.py?hl=en&answer=45656

+(When I saved as a csv with Excel 2008 and opened the resulting file in a text editor, it was in fact a semicolon separated value file....I therefore had to substitute all semicolons for commas)+

Directions to 2-way sync google calendars with ical and thunderbird:

https://www.google.com/support/calendar/bin/answer.py?hl=en&answer=99358

Nov 16, 2011 10:54 PM in response to Hebhebs

If you dont want to bother with the scripting -- you can just import the CSV into a google calendar and then export it back out as an ics, then you import that ics file into ical.

Took me all of 5 minutes to do it.


Here is how to import csv into google calendar:

http://www.google.com/support/calendar/bin/answer.py?hl=en&answer=37118&topic=16 72003


This is the google help file on getting your CSV formatted properly in case there is a problem:

http://www.google.com/support/calendar/bin/answer.py?answer=45656


Here is how to export out of google calendar:

http://www.google.com/support/calendar/bin/answer.py?answer=37111

Apr 5, 2014 12:22 PM in response to stephkr

Hi,


My Wife is training for the NY Marathon.


I listed the training plan in excel, saved the data with appropriate headings and converted it to ical for import.


Apart from missing some headings that resulted in an initial failure, it worked like a charm (Location, Private)


Everything you need to know is here ..


http://n8henrie.com/2013/05/spreadsheet-to-calendar/

Import Excel Schedules to iCal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.