Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Make uneditable events in iCal editable' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Make uneditable events in iCal editable
Authored by: robleach on Jun 22, '11 10:48:04AM
I forgot to take out the dialog message I was using for debugging, so here's the script without that, a little tidying up, a fix for some file formats which list the ORGANIZER line as 'ORGANIZER;' instead of 'ORGANIZER:', and a fix for the finder trying to open the .tmp file because I hadn't put the open_this_item in the if block:
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 path of the file
			set pathstr to POSIX path 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 with icon 2
			do shell script cmd
			tell application "Finder"
				open this_item
			end tell
		end if
		
	end repeat
	
end adding folder items to
Also, I've noted that sometimes I get an error from iCal when I choose to add the event to a google calendar synced via calDAV that asks me to either revert to server or go offline. Reverting to server deletes the added event, so what I've done to get around this is to go offline, edit the event, then cut and paste it onto a non-google calendar, refresh the google calendar, then paste the event back into the google calendar. For some reason, that worked when importing did not.

Rob
Edited on Jun 22, '11 11:22:47AM by robleach


[ Reply to This | # ]