variable in an ical event property

What am I doing wrong here?


set DefaultTime to "8:00:00 AM"
activate
set StartDateQuery to (display dialog "What day would you like this program to play?" default answer (date string of ((current date))))
set startdate to date (text returned of StartDateQuery)
set StartTimeQuery to (display dialog "What time (24-hour format) would you like this program to start?" default answer DefaultTime)
set StartTime to date (text returned of StartTimeQuery)
set EventStart to date (time string of StartTime) of startdate
set EndDay to date "11:30 PM" of startdate


if weekday of EndDay is Friday then
	set TillFriday to 7
	
else if weekday of EndDay is Saturday then
	set TillFriday to 6
	
else if weekday of EndDay is Sunday then
	set TillFriday to 5
	
	
else if weekday of EndDay is Monday then
	set TillFriday to 4
	
else if weekday of EndDay is Tuesday then
	set TillFriday to 3
	
else if weekday of EndDay is Wednesday then
	set TillFriday to 2
	
else if weekday of EndDay is Thursday then
	set TillFriday to 1
	
end if

set RepeatDate to (startdate + TillFriday * days)
tell RepeatDate to return text 1 thru 8 of (year * 10000 + (its month as integer) * 100 + day as string)

--set yyyy to year of RepeatDate as text
--set mm to month of RepeatDate as text
--set dd to day of RepeatDate as text
set RecurrenceText to "FREQ=DAILY;INTERVAL=1;UNTIL=" & RepeatDate


get RecurrenceText

All the “get” is giving me is 20070313. What I want is “FREQ=DAILY;INTERVAL=1;UNTIL=20070313” with quotes included.

Hi,

remove the return statement from

tell RepeatDate to return text 1 thru 8 of (year * 10000 + (its month as integer) * 100 + day as string)

...
tell RepeatDate to text 1 thru 8 of (year * 10000 + (its month as integer) * 100 + day as string)


--set yyyy to year of RepeatDate as text
--set mm to month of RepeatDate as text
--set dd to day of RepeatDate as text
set RecurrenceText to "FREQ=DAILY;INTERVAL=1;UNTIL=" & result
get RecurrenceText

awesome!! thanks.