Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Im using FM12 and wish to export some data into iCal ver.6 which comes with Mountain Lion.

Been playing around with:

You will have to get your hands dirty using applescript; Here is a script I picked up from Jonathan Stark. Please note the caveats. If you don t know how to use apple script just change the cell descriptors in the "-- grab the data from Filemaker" section. Hope it helps.

(*

Create Event

Copyright © 2005 Jonathan Stark

This script automates the process of creating iCal calendar events from FileMaker records.

You may incorporate this sample code into your program(s) without

restriction. This sample code has been provided "AS IS" and the

responsibility for its operation is yours. You are not permitted to

redistribute this sample code as "Jonathan Stark sample code" after having

made changes. If you're going to redistribute the code, I would appreciate it

if you make it clear that the code was descended from Jonathan Stark's sample

code, but that you've made changes.

Have fun!

Visit www.jonathanstark.com for

more fun with FileMaker,

AppleScript, iCal, and more...

*)

-- grab the data from Filemaker

--edited by user

tell application "FileMaker Pro Advanced"

tell current record

--set theCalendarTitle to cellValue of cell "gstaff"

set theCalendarTitle to "staff leave"

set theSummary to cellValue of cell "booked leave::icalSummary"

--set theDescription to cellValue of cell "Description"

set theDescription to ""

set theStartDate to cellValue of cell "booked leave::Start"

--set theStartTime to cellValue of cell "Start Time"

set theStartTime to "0"

set theEndDate to (cellValue of cell "booked leave::icalfinish")

--set theEndTime to cellValue of cell "End Time"

set theEndTime to "0"

--set theAllDay to cellValue of cell "All Day"

set theAllDay to "1"

end tell

end tell

set theStartDateAsText to theStartDate & " " & theStartTime as text

set theEndDateAsText to theEndDate & " " & theEndTime as text

-- convert text to dates

set theStartDate to date theStartDateAsText

set theEndDate to date theEndDateAsText

-- create the event in iCal

tell application "iCal"

activate

-- make new calendar if need be

set allCalendarTitles to the title of every calendar

if allCalendarTitles contains theCalendarTitle then

set theCalendarNumber to (first calendar whose title is theCalendarTitle)

else

set theCalendarNumber to (make calendar at end of calendars with properties {title:theCalendarTitle})

end if

-- make event

set theEvent to make event at end of events of theCalendarNumber

-- set the event properties

tell theEvent

set start date to theStartDate

set end date to theEndDate

set summary to theSummary

set description to theDescription

if theAllDay = "1" then

set allday event to true

end if

end tell

show theEvent

end tell

and managed to get it to work with a button on my layout that will run this script.

Is there a way to show on the layout that the button has been clicked and also is there a way to stop multiple clicking, because every time its clicked the script runs and creates another copy in iCal.

Thanks in anticipation

  • 3 months later...
Posted

If you actually have the Applscript working the way you want, your problem is not really with Applescript. It is a problem with Layouts and Fields.

 

Anyway, I'd setup a text field that can be a space " " or nothing.

Then, create a valuelist with a space " ".

Then, drop it on the appropriate layout and format it as a checkbox that references the above valuelist.

Create a script that only executes the applescript if the above field is empty and after successful execution sets the field to a space " ".

Finally, I'd tie the field instance on the layout to the above script.

 

Hope this helps.

  • 4 months later...
Posted

i'm sorry if i open this thread again, i have try that applescript, and it works, but my question is this, how can i modify it to save on an existing calendar?

on my mac calendar, i have 2 gmail calendar, "work" and "personal" i'd like to create the new event in Gmail-->"work" calendar. thanx

This topic is 4218 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.