Exporting from Calendar to a CSV file

C

chidwick

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Email Client: Exchange

I have a need to export my Entourage calendar events to a CSV file including the columns for "event name", start date, end date, category

There are a number of scripts on the internet, but none that i can find for Mac OS X 10.5 (Leopard).

Your help is much appreciated.

Thanks

Mark
 
M

Mark Chidwick

Michael
Thanks for the reply. I did go to Paul's scripts and ignored his warning that the activation codes do not work for MacOS 10.5. I purchased the scripts, but alas, he was right, the activation codes do not work.

I would love to contact Paul somehow - get a working activation code... but no clue how to find him.

In the event this is a dead end, do you know of any other script source where I can export calendar events from Entourage

Thanks

Mark

Check out Paul Berkowitz's "Export-Import Entourage" script package. I'm
fairly sure that works on Leopard even though it may not be documented
as such. <http://www.scriptbuilders.net/search.php?search_str=Export-Import+Entourage>





Version: 2008 > Operating System: Mac OS X 10.5 (Leopard) > Processor:
Intel > Email Client: Exchange > > I have a need to export my Entourage
calendar events to a CSV file including > the columns for "event name",
start date, end date, category > > There are a number of scripts on the
internet, but none that i can find for > Mac OS X 10.5 (Leopard). > >
Your help is much appreciated. > > Thanks > > Mark
 
D

Diane Ross

Mark Chidwick said:
I would love to contact Paul somehow - get a working activation code... but no
clue how to find him.

Paul recently left the MVP program because of work considerations. If you
fid someone on Tiger, you could do your work there.
 
M

Mark Chidwick

Diane

Thanks for the quick response. I am a consultant, recently and permanently converted to mac. I keep track of my time using Entourage. Each month, I need to dump the calendar events (works very well in Outlook) and then I use this to generate my monthly invoices.

Clever idea using Tiger... Unfortunately everyone in the office are techies and have the latest and greatest (which is why we are all mac's)

There has to be someone out there that knows how to export calendar events from Entourage

Thanks again
 
D

Diane Ross

Mark Chidwick said:
There has to be someone out there that knows how to export calendar events
from Entourage

You can export as an Entourage archive file (.rge) but they can only be used
by Entourage.

I might be on the wrong track so bear with me....

In the Calendar view, you can create a custom view. There are several
default views that will guide you. When you select a view, it lists each
item as an event. You can select all and drag to the desktop. (I suggest
dragging to a folder or you'll have an unmanageable mess) Each event is
saved as an .ics file.

If the .ics file doesn't work, can you describe what file type you want to
create your invoices?

I hesitate to mention syncing to the Apple Address Book and create your
invoices from it. So many users get duplicates, missing data etc with sync
right now. Often their are options for the Address Book that aren't
available for Entourage so syncing gets around that limitation.

BTW, I recently did a reinstall of the OS and when I tried to enter my code
for Paul's scripts, I had no problem entering the code. The calendar export
is a text file. If you export your events as an Entourage archive file and
send it to me, I'll import into a new Identity and export using Paul's
script and send that back. This way you can see if it would work for you.

<http://blog.entourage.mvps.org/per/2008/12/contact-me.html>
 
M

Mark Chidwick

Diane

I was able to get a whole set of ics files as you outlined. I see that ics files are simple text files. I could write some code to then parse these files and generate a CSV file that excel can read.

What I am after is a CSV file containing the following columns
- name of the event (description)
- start date
- start time
- end time
- category

Unfortunately, the ICS files do not have many of the attributes of the calendar event (category, project, etc), which I use to separate time between my various clients.

As a consultant yourself, do you use Entourage to organize your time? How do you handle this? Perhaps I am on the wrong track.

Thanks again
 
D

Diane Ross

Mark Chidwick said:
What I am after is a CSV file containing the following columns

A scripter might be able to help with this. You would probably have to pay
them for something this specialized. I'll ask and get back.
As a consultant yourself, do you use Entourage to organize your time? How do
you handle this? Perhaps I am on the wrong track.

No, since I don't get paid. You might look at other alternatives to
Entourage to manage this. Also asking with a different subject using
"invoices" and "calendar" in the subject might get some responses.

I did a quick Google search using "mac invoices calendar Entourage" and the
only thing I found was around $500. Ouch!
 
M

Mark Chidwick

I have a temporary solution, but if a scripter could provide a script to export to a CSV file, this would be better.

I took your suggestion of copying all the ICS files to a temp folder, then wrote a Java program to read those files and generate the CSV file.

Its a hack, but it works. A script would be preferable.

If anyone is interested in the Java code, they are welcome to it (as is).

Mark
 
D

Diane Ross

Hi Mark.

I found a script on Scriptbuilders (freeware) by Paul Berkowitz, but it
requires a scripting addition Akua Sweets that doesn't seem to work in
Leopard. It's possible this will give you a starting point.

ScriptBuilders: Import Calendar Events (Entourage) 1.0.1
<http://scriptbuilders.net/files/importcalendareventsentourage1.0.1.html>

Bill Smith, another MVP passed this along.

It's probably scriptable. A quick look at the properties of one calendar
event returns this information:

subject:"New Year's Eve"
location:""
content:""
start time:date "Wednesday, December 31, 2008 12:00:00 AM"
end time:date "Thursday, January 1, 2009 12:00:00 AM"
all day event:true
recurring:false
project list:{}
project sharing list:{}
category:{category id 9 of application "Microsoft Entourage", category
id 20 of application "Microsoft Entourage"}
links:{}
remind time:0
recurrence:""

There is a list that might be able to help you. There are some high powered
scripters on this list. If someone there can't help you then it probably
can't be done.

AppleScript-Users mailing list

Apple Lists Search: applescript
<http://search.lists.apple.com/?q=applescript&cmd=Search!>

If you do accomplish this, be sure to let us know. I can post it for others
to download.
 
D

Diane Ross

Barry Wainwright one of the long time Mac MVPs and a prolific scripter has
provided a script for you. You can download here:

<http://www.entourage.mvps.org/script/fav_scripts.html#exportselectedevents>

In case the above link does not work:

<http://tinyurl.com/77v2q7>

Let us know how it works for you.

BTW, he also created the script that automatically made the tiny url without
having to go to the web site to create it. However, he is most known for his
Insert Safari URLs and Insert FireFox URLs into a message.

You can get the Make Tiny URLs script here:

Create a TinyURL-no more broken links Part 4

<http://blog.entourage.mvps.org/2008/09/create_a_tinyurl.html>
 
G

Guest

I have downloaded the script and installed. However, I dont have Excel on mac, I have Excel running in Parallels. I do have Numbers.app. If changing the script for Numbers is easy, this would be appreciated.

However, if its a pain, no worries, I will go out and purchase MS Office for mac.

Your help on this problem has been most appreciated. Thanks to both you and Barry.

Mark
 
D

Diane Ross

I have downloaded the script and installed. However, I dont have Excel on mac,
I have Excel running in Parallels. I do have Numbers.app. If changing the
script for Numbers is easy, this would be appreciated.

It could be simple, but I can't say for sure. This portion of the script
would need to be changed. I believe the first part for Entourage would not
need changing.

tell application "Microsoft Excel"
set wb to make new workbook
set dataRange to get resize range "A1" row size (count ¬
exportList) column size 5
set value of dataRange to exportList
end tell
However, if its a pain, no worries, I will go out and purchase MS Office for
mac.

You should be able to share the Excel file with Windows Excel. Heck I would
try to see if Numbers can open the file that was created.

If you have Entourage, is this a standalone version?

If you don't need Exchange you can get Office 2008 very reasonably. $109.99

<http://tinyurl.com/4ydu2u>

If you need the standard version that includes Exchange support. $234.43
<http://tinyurl.com/4xwy6u>
 
M

Mark Chidwick

Not being a scripter, I am unsure how to edit this script. However, I did use the "script editor" to make the changes you suggested, but with an error "Expected end of line, etc. but found identifier.'

This scripting language is quite interesting.

Here is what you have provided so far

-- Export Selected Events v1.0 (2009-01-03)
-- an applescript by Barry Wainwright <mailto:[email protected]>
-- exports certain data from selected events to an excel spreadsheet.
-- Written in response to a user request
-- This script released under a Creative Commons Attribution,
-- NonCommercial, ShareAlike 2.0 England & Wales License.
-- see <http://creativecommons.org/licenses/by-nc-sa/2.0/uk/> for full
-- details

tell application "Microsoft Entourage"
try
set theSelection to selection
if class of theSelection is list then
set itemClass to class of item 1 of theSelection
else
set itemClass to class of theSelection
end if
if itemClass ≠ event then error -99
on error errMsg number errNum
display dialog "your selection does not contain any ¬
events" buttons {"OK"} default button 1
return
end try
set exportList to {{"Name", "Start Date", "Start Time", ¬
"End Time", "Category"}}
repeat with anEvent in theSelection
set eventData to {mysub:subject, myST:start time, myET:end time, myCat:category} ¬
of anEvent
set myStartDate to short date string of myST ¬
of eventData
set myStartTime to time string of myST of eventData
set myEndTime to time string of myET of eventData
set catNames to {}
repeat with aCat in myCat of eventData
copy name of aCat to end of catNames
end repeat
set {oldTIDS, AppleScript's text item delimiters} to ¬
{AppleScript's text item delimiters, {", "}}
set myCatNames to catNames as text
set AppleScript's text item delimiters to oldTIDS
copy {mysub of eventData, myStartDate, myStartTime, ¬
myEndTime, myCatNames} to end of exportList
end repeat
end tell

tell application "Microsoft Office Excel"
set wb to make new workbook
set dataRange to get resize range "A1" row size (count ¬
exportList) column size 5
set value of dataRange to exportList
end tell

One of my clients required that I use Entourage for Exchange and they purchased the license of Entourage for me. I have iWork and didnt see a need (until now) to purchase office on the mac. However, for $109, I might just do that.

Again, I really appreciate all your efforts !
 
D

Diane Ross

Mark Chidwick said:
"Expected end of line, etc. but found identifier.'

That's because the Mactopia forum's formatting screwed up the line endings.
Try opening the script in the Apple Script editor and editing it there. Work
on a copy. :)
One of my clients required that I use Entourage for Exchange and they
purchased the license of Entourage for me. I have iWork and didnt see a need
(until now) to purchase office on the mac. However, for $109, I might just do
that.

It's a bit tricky to use the standalone Exchange version of Entourage with
the home version. See this article on how to:

Install Standalone version of Entourage from Exchange Email Provider with
the Home & Student Version

<http://blog.entourage.mvps.org/2008/08/install_standalone_version.html>

<http://tinyurl.com/6fx99e>
 
B

Barry Wainwright [MVP]

Hi,

Sorry, I had assumed that you had Excel available since your were running
Entourage! I guess you got Entourage 204 as part of a corporate Exchange
license scheme.

I will ake a look at Number and see if it can be scripted, but I don't hold
out a lot of hope! If not, I will modify the script to write a CSV file
instead. I know this is what you riginally asked for, but thought I would
save the extra step of importing ito excel! Ah well, so be it :)
 
M

Michel Bintener

As far as I know, Numbers does not support AppleScript.


Hi,

Sorry, I had assumed that you had Excel available since your were running
Entourage! I guess you got Entourage 204 as part of a corporate Exchange
license scheme.

I will ake a look at Number and see if it can be scripted, but I don't hold
out a lot of hope! If not, I will modify the script to write a CSV file
instead. I know this is what you riginally asked for, but thought I would
save the extra step of importing ito excel! Ah well, so be it :)

--
Michel Bintener
Microsoft MVP
Office:mac (Entourage & Word)

*** Please always reply to the newsgroup. ***
 
M

Mark Chidwick

I should have been more precise. Never the less, if the script can easily be altered to export a CSV file, then I will use that. If not, then I will purchase the Office for Mac and try the script you provided.

THanks again for all this help.
 
B

Barry Wainwright [MVP]

OK, here's a script that will save the data to a tab delimited text file
(it's easier to write than a CSV file and Numbers doesn't handle CSV properly
- not with embedded commas or returns in the data). It will also open the
said file in Numbers for you automatically (you can still open the saved data
in excel in parallels as well, if you like).

If you don't want Numbers to open the file automatically, just leave out the
last four lines of code.

-- Export Selected Events v1.1 (2009-01-04)
-- an applescript by Barry Wainwright <mailto:[email protected]>
-- exports certain data from selected events to an excel spreadsheet.
-- Written in response to a user request
-- This script released under a Creative Commons Attribution,
-- NonCommercial, ShareAlike 2.0 England & Wales License.
-- see <http://creativecommons.org/licenses/by-nc-sa/2.0/uk/>
-- for full details

-- Version History
-- v1.1 2009-01-04 - changed script to write to TDT file instead of
-- putting data straight into excel
-- v1.0 2009-01-03 - First Release


tell application "Microsoft Entourage"
try
set theSelection to selection
if class of theSelection is list then
set itemClass to class of item 1 of theSelection
else
set itemClass to class of theSelection
end if
if itemClass ≠ event then error -99
on error errMsg number errNum
display dialog ¬
"your selection does not contain any events" buttons {"OK"} default
button 1
return
end try
set exportList to {"Name" & tab & "Start Date" & tab ¬
& "Start Time" & tab & "End Time" & tab & "Category"}
set {oldTIDS, AppleScript's text item delimiters} to ¬
{AppleScript's text item delimiters, {", "}}
repeat with anEvent in theSelection
set eventData to {mysub:subject, myST:start time, myET:end time,
myCat:category} ¬
of anEvent
set myStartDate to short date string of myST of eventData
set myStartTime to time string of myST of eventData
set myEndTime to time string of myET of eventData
set catNames to {}
repeat with aCat in myCat of eventData
copy name of aCat to end of catNames
end repeat
set {oldTIDS, AppleScript's text item delimiters} to ¬
{AppleScript's text item delimiters, {", "}}
set myCatNames to catNames as text
set AppleScript's text item delimiters to oldTIDS
set dataLine to mysub of eventData & tab & myStartDate ¬
& tab & myStartTime & tab & myEndTime & tab & myCatNames
copy dataLine to end of exportList
end repeat
end tell

set outFile to choose file name default location (path to desktop) as alias ¬
default name "Event Export " & short date string of (current date) & ¬
".txt" with prompt "Please choose a location to save the data:"
try
set theFile to open for access outFile with write permission
on error
try
close access outFile
end try
end try
set {oldTIDS, AppleScript's text item delimiters} to ¬
{AppleScript's text item delimiters, {return}}
write (exportList as text) to theFile
set AppleScript's text item delimiters to oldTIDS
close access theFile

-- Delete the following code if you don't want
-- Numbers to open the file automatically
tell application "Numbers"
activate
open outFile
end tell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top