below is my current script, that has evolved from a while back when i first started this. What i want to modify is this:
-
Is there a way to modify a calendar, instead of replacing it? for example… originally i have a calendar of to-dos made from an excel file. Later, when the excel file gets modified, it automatically looks in ical for the existing calendar, deletes and then make a new one of same name with new to-dos. INSTEAD…after the excel file is modified, I want it to look for the existing calendar, then compare the titles & dates. If they dont match the new file, then it should ONLY replace the unmatched to-dos.
-
If #1 is not possible, then is there a way to make any new to-dos complete ONLY if the date is passed. so…if i make a new calendar and some of the dates are from last week or earlier, then they are marked as completed. If the dates are today or later, then they are NOT marked as completed.
-
is there a way to specify the group that the new calendar should be made in?
-
Is there a way to get the description for a to-do to be 2 variables, for example ProjectName - ReviseDate
on adding folder items to this_folder after receiving added_items
tell application "Microsoft Excel"
repeat with anitem in added_items
open anitem
print out active sheet
set ProjectName to the value of cell "$F$4"
set ReviseDate to the value of cell "$Z$4" as string
tell (get value of range "D12:Z12") to set these_Dates to list 1
my Schedule(ProjectName, ReviseDate, these_Dates)
close front window
end repeat
end tell
end adding folder items to
on Schedule(ProjectName, ReviseDate, these_Dates)
set the_titles to {"All Tooling Patterns in HK", "Rough Ceramics", "Tooling Quote Submitted", "Casting Ceramics", "Approval of Casting Ceramics", "Rough Ceramics to Tempe", "Tooling PO in HK", "Tooling Start", "Paintmaster in HK", "Production Quote Submitted", "Production Facility Confirmed", "1st Shot Samples", "Blister Layout in HK", "1st Deco Samples", "Mock-up Packaging Samples", "Packaging Artwork in HK", "EP Samples", "Production PO in HK", "Release Printing", "Release Injection", "Release Decoration", "PP Samples", "1st Shipment"}
set tc to count the_titles
tell application "iCal"
if (exists calendar ProjectName) then delete calendar ProjectName
set theCal to make new calendar at end of calendars with properties {title:ProjectName, color:{37500, 0, 0}, description:ReviseDate}
tell theCal to repeat with i from 1 to tc
set t_date to item i of these_Dates
if (t_date is not "N/A" and t_date is not "" and t_date is not "NA" and t_date is not "on hold") then ¬
make new todo at end of todos with properties {due date:t_date, summary:item i of the_titles, location:ReviseDate, allday event:true, status:confirmed, description:ProjectName}
end repeat
quit
end tell
end Schedule