I recently synchronized my Facebook events with my Google calendar, and then I added that calendar to iCal via CalDAV. When I want to add one of those events to one of my published calendars on my website, I always try to copy the event from the Facebook events calendar and paste it in the other calendar.
However, I usually want to edit the event which sometimes causes all sorts of headaches because it's either not editable (even though I'm editing a copy in my own calendar) or it wants to send emails to all my invitees. This is due to the fact that I am not recognized as the event's organizer. So I devised a rudimentary way to make such copied events editable and hassle free. My solution is crude and slightly convoluted, so I am hoping someone out there will post a better version in the comments.
Basically, I used a Folder Action to obtain an .ics file of the single event, edit it to remove the ORGANIZER field, and then open the edited file.
First, you'll have to create a convenient folder to drag your events to and attach the following AppleScript:
I created a folder called MakeEventsEditable, put it in a handy spot, enabled Folder Actions, and then attached my script.
One caveat on the next step -- events in a subscribed Facebook events calendar cannot be dragged to a folder, so to get around this, you have to Control+click on the event and select 'Mail Event.' This will bring up an email with the ics file attached. Drag that attached event file to your folder with the attached Folder Action.
It will create a temporary file with the edited contents and then replace the old version with the new. If someone knows how to do a safe clean-up of the file after it's been added to iCal, please edit the script for me and post it in the comments.
The script will then open the edited event in iCal, which will prompt you to select a calendar to add it to. Note, if you add it to a Google calendar via CalDAV, sometimes the event will disappear in a few seconds. To bring it back, refresh that calendar. This works reliably for me.
Now you have an editable event. Every once in awhile, you'll have to clean out that folder. I'm going to be using this a lot. If you find you are having trouble with any events using this script, there may be other fields in the file that will need to be edited or removed as well.
[crarko adds: I haven't tested this one.]
However, I usually want to edit the event which sometimes causes all sorts of headaches because it's either not editable (even though I'm editing a copy in my own calendar) or it wants to send emails to all my invitees. This is due to the fact that I am not recognized as the event's organizer. So I devised a rudimentary way to make such copied events editable and hassle free. My solution is crude and slightly convoluted, so I am hoping someone out there will post a better version in the comments.
Basically, I used a Folder Action to obtain an .ics file of the single event, edit it to remove the ORGANIZER field, and then open the edited file.
First, you'll have to create a convenient folder to drag your events to and attach the following AppleScript:
on adding folder items to this_folder after receiving added_items
repeat with i from 1 to number of items in added_items
set this_item to item i of added_items as alias
tell application "Finder"
--get the name of the file
set pathstr to POSIX path of this_item
--set this_file_name to the name of this_item
set exT_name to name extension of this_item
end tell
if the exT_name is "ics" then
set cmd to "grep -v ^ORGANIZER: '" & pathstr & "' > '" & pathstr & ".tmp'; mv '" & pathstr & ".tmp' '" & pathstr & "'"
display dialog cmd buttons {"OK"} default button 1 default answer "" with icon 2
do shell script cmd
end if
tell application "Finder"
open this_item
end tell
end repeat
end adding folder items to
One caveat on the next step -- events in a subscribed Facebook events calendar cannot be dragged to a folder, so to get around this, you have to Control+click on the event and select 'Mail Event.' This will bring up an email with the ics file attached. Drag that attached event file to your folder with the attached Folder Action.
It will create a temporary file with the edited contents and then replace the old version with the new. If someone knows how to do a safe clean-up of the file after it's been added to iCal, please edit the script for me and post it in the comments.
The script will then open the edited event in iCal, which will prompt you to select a calendar to add it to. Note, if you add it to a Google calendar via CalDAV, sometimes the event will disappear in a few seconds. To bring it back, refresh that calendar. This works reliably for me.
Now you have an editable event. Every once in awhile, you'll have to clean out that folder. I'm going to be using this a lot. If you find you are having trouble with any events using this script, there may be other fields in the file that will need to be edited or removed as well.
[crarko adds: I haven't tested this one.]
•
[4,262 views]

