First Script - missing final part

this is my first script. i really enjoy trying, i hope to enjoy a successful script at some point.

because i don’t know much about this i have used automator for much of the action.

i have a rss feed that is a daily bible reading. i want this for each day on my ical events notes (to read on ipod touch whenever).

i used automator to get the text from the rss feed.

i tried to make two applescripts - one to copy the feed from the text editor, and the next one to put it into the event description part. it stalls on “thedescription” part at the end.

please help. thanks
eric

automator part - get feeds from mail, get text from articles, new text file, set contents of TextEdit Document, find finder items, open finder items

then applescript
tell application “TextEdit”

	delay 1
	tell application "System Events"
		keystroke "a" using command down
		keystroke "c" using command down
		return input
	end tell
end tell

tell application “iCal”

	set theCal to "Bible Readings"
	set thedescription to contents of selection
	set newEvent to make new event at end of events of calendar theCal with properties {summary:"Daily Bible Readings", start date:(current date), allday event:true, description:thedescription}
	
end tell
return input

end run

Hi Eric,

welcome to MacScripter.

I guess, you can do it much easier and without involving TextEdit

For the automator part actually only these two actions are needed: get feeds from mail, get text from articles
and this script


on run {input, parameters}
	tell application "iCal"
		set theCal to "Bible Readings"
		set newEvent to make new event at end of events of calendar theCal with properties {summary:"Daily Bible Readings", start date:(current date), allday event:true, description:input as text}
		
	end tell
	return input
end run

wow, thats awesome, it works great. thanks stefan.

another quick question (i hope)

i want to make my to do list, a daily all day event, with the to-do’s in the notes.

i used the automator to find all my to do’s (Find Calendars in iCal)

and then used this -

on run {input, parameters}
	tell application "iCal"
		set theCal to "Unfiled"
		set newEvent to make new event at end of events of calendar theCal with properties {summary:"To Do List", start date:(current date), allday event:true, description:input as text}
		
	end tell
	return input
end run

only problem is the automator, when it finds the todos in ical, doesn’t use the same input. i need to make the titles a text input.

thanks
eric

Find Calendars in iCal returns only the calendar (id), not any contents.
Sorry, I probably don’t understand, what you’re going to accomplish.

You want to create an event of all to-dos of a specific due day (today)?

i want to make a script that turns the todolist into a daily all-day event with the notes listing all the todo items. i do this all the time anyways, since my ipod touch doesn’t have notes. i copy all the todoitems and then paste it into the notes of an event that i title To Do Items.
eric

I hope, I got it right,
this is a solution without Automator


property theCal : "Unfiled"

tell application "iCal"
	choose from list (get name of calendars) with prompt "Choose Source Calendar:"
	tell result
		if it is false then error number -128
		set sourceCal to item 1
	end tell
	tell calendar sourceCal to set theTitles to summary of every todo
	set {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
	set newEvent to make new event at end of events of calendar theCal with properties {summary:"To Do List", start date:(current date), allday event:true, description:theTitles as text}
	set AppleScript's text item delimiters to ASTID
end tell

Stefan - thank you again. its perfect!
You have been a big help today.
God bless you
eric