For my first foray into producing an Applescript, I wanted to:
take data from within a Filemaker Pro database
create an iCal event
return the iCal ID to Filemaker and
generate a .ics file.
I have successfully managed to extract the relevant data and create the iCal event, but
I have no idea how to create a .ics file for the event
I cannot return the iCal ID to the Filemaker database
The script is as follows:
--Get relevant data from Filemaker database
tell application "FileMaker Pro Advanced"
tell document "Data S5"
set JobNature to cell "Job Nature"
set Notes to cell "Notes"
set JobLocation to cell "Address Town"
set DateStart to repetition 1 of cell "Dates"
set DateEnd to cell "Date End"
end tell
end tell
--Set start and end dates to date format
set DateEnd to date (DateEnd)
set DateStart to date (DateStart)
--Get iCal to create new event
tell application "iCal"
activate
tell calendar "Jobs"
set newEvent to make new event at end with properties {description:Notes, summary:JobNature, location:JobLocation, start date:DateStart, end date:DateEnd, allday event:true}
set JobID to the result
--How can one get Applescript to create a .ics file for this event of the sort which is attached to an email if one control clicks the event and chooses 'Mail Event'
end tell
view calendar at DateStart
end tell
tell application "FileMaker Pro Advanced"
tell document "DBInsp Data S5"
set cell "Commendation" to JobID
--This line comes up with the error message "Can’t make «class wrev» id "847A59A2-8DDF-4D06-BFCC-875DECD9E980" of «class wres» id "5DF80EB9-9315-4448-922E-7C3A934B43B8" of application "iCal" into the expected type."
end tell
end tell
Any help would be greatly appreciated.