Jump to content

Filemaker to iCal


This topic is 6823 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hope someone can help me !!

I'm trying to create a new event in iCal using a date field from Filemaker using Applescript.

Here is the script i've got:

set calTitle to "Work"

set eventTitle to "Filemaker Test"

set eventDay to cell "date_day" of current record

set eventMonth to cell "date_month" of current record

set eventYear to cell "date_year" of current record

tell application "iCal"

set bDate to current date

set time of bDate to 32400 -- seconds, = 9 hours = 9am

set year of bDate to eventYear

set month of bDate to eventMonth

set day of bDate to eventDay

set myevent to make new event at the end of events of (item 1 of (calendars whose title is calTitle))

Link to comment
Share on other sites

  • 1 month later...
  • 7 months later...
  • 8 months later...

I know this topic is over a year old now but I want to incorporate adding iCal events into my FM program. Did anyone ever have any luck with this or know of a tutorial out there somewhere that might be able to help me out?

Thanks,

Abraham

Link to comment
Share on other sites

  • 1 year later...
  • Newbies

I have recently been wanting to do this also and through a bit of Applescript research and other posts on the web I created this AppleScript which may help you. It will prompt you to enter in all details of your meeting and post the event into iCal. simply use this AppleScript as a 'Perform Applescript' step in a filemaker script.

Thanks, Paul.

set alarmTrigger to "-20"

set soundName to "Sosumi"

set TodaysDate to current date

set TodaysDate to date string of TodaysDate

set MakeNewEvent to true

tell application "iCal"

set CalendarList to every calendar

set CalendarNames to title of every calendar

end tell

set theCalendar to choose from list the CalendarNames with prompt ¬

"Choose target calendar from list"

tell application "iCal"

repeat with i from 1 to count of CalendarList

if theCalendar as string is the title of calendar i as string then

set TargetCalendar to calendar i

end if

end repeat

end tell

set the result to display dialog "Enter the summary of the Event (required)" default answer "Meeting with "

set theSummary to text returned of the result

set today to my PrepDate()

set result to display dialog "Enter the starting date" default answer today

set tempStartDate to (text returned of the result)

set result to display dialog "Enter the starting time (leave blank for all day)" default answer "9:00AM"

set tempStartTime to (text returned of the result)

if tempStartTime is "" then

set eventIsAllDay to true

set tempStartTime to "9:00AM"

set thestartdate to my fixStartDate(tempStartDate & ", " & tempStartTime)

set theDuration to 8 * 60

else

set eventIsAllDay to false

set thestartdate to my fixStartDate(tempStartDate & ", " & tempStartTime)

set result to display dialog "Enter the duration in minutes" default answer "60"

set theDuration to (text returned of the result)

end if

set theEndDate to thestartdate + theDuration * minutes

set result to display dialog "Enter the location of the event" default answer "Red-i Design Boardroom"

set theLocation to (text returned of the result)

tell application "iCal"

tell TargetCalendar

set NewEvent to make new event at end of events with properties {start date:thestartdate, end date:theEndDate, summary:theSummary as string, location:theLocation, allday event:eventIsAllDay}

tell NewEvent

make new sound alarm at end of sound alarms with properties {trigger interval:alarmTrigger, sound name:soundName}

end tell

end tell

end tell

on fixStartDate(tempStartDate)

set thestartdate to date tempStartDate

return thestartdate

end fixStartDate

on PrepDate()

set thisdate to ((current date) + 1 * days)

set monthlist to {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}

repeat with theMonth from 1 to 12

if (month of thisdate as string) is (item theMonth of monthlist) then exit repeat

end repeat

set theYear to the year of thisdate

set theDay to the day of thisdate

set today to theDay & "/" & theMonth & "/" & theYear as string

return today

end PrepDate

show event

Link to comment
Share on other sites

  • 1 month later...

For what it's worth, here's a script that works:

tell application "FileMaker Pro"

tell current record of window 1

set dateStartTxt to cell "AlarmTimestamp"

--set dateEndTxt to cell "TimeStampEnd"

set theSummary to cell "AccountID"

--set theCalendar to cell "CalendarName"

end tell

end tell

set DateStart to date dateStartTxt

--set DateEnd to date dateEndTxt

tell application "iCal"

tell calendar "work"

set new_event to make new event at end of events

tell new_event

set start date to DateStart

--set end date to DateEnd

set summary to theSummary

--set location to "some location"

set allday event to false

set status to confirmed

make new sound alarm at end of sound alarms with properties {trigger interval:-5, sound name:"glass"}

end tell

end tell

end tell

Link to comment
Share on other sites

This topic is 6823 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.