November 6, 20205 yr Newbies I can get the native apple script to work within the scripting , however when I try and covert it to work within the Calculated section I'm struggling to find the correct method and syntax. Having searched the net for days and tried multiple ways I'm desperate for some help. The native apple script is set theStartDate to (current date) + (1 * days) set hours of theStartDate to 15 set minutes of theStartDate to 0 set seconds of theStartDate to 0 set theEndDate to theStartDate + (1 * hours) tell application "Calendar" tell calendar "Home" make new event with properties {summary:"Important Meeting!", start date:theStartDate, end date:theEndDate} end tell end tell What I am trying to do by moving it to Calc section is introduce variables for the message summary " $TempName" and $TempDays which will create an event in the Calendar with the clients name at a given number of days from today. Any suggestions would be greatly appreciated Regards Colin
November 6, 20205 yr See if this helps: https://fmforums.com/topic/106820-calculated-applescript-syntax/?do=findComment&comment=482614&_rid=72594 Edited November 6, 20205 yr by comment
November 6, 20205 yr Author Newbies Hi Thanks, No that didn't help . I can get it to work by putting the whole apple script in a text field and then just run it through the cal script. But I can't see how to integrate the variables- when ever I try I just can't get the syntax right either by using forward slashes etc. If its possible to see an example of what the syntax would look like if the above script was entered into the calc filed of the apple script Thanks Colin
November 6, 20205 yr 10 minutes ago, Colin Yorkshire said: I can't see how to integrate the variables I thought that's exactly what that post shows. If you had followed the first option, you would have ended up with something like: "set theStartDate to (current date) + (" & $TempDays & " * days) ¶ set hours of theStartDate to 15 ¶ set minutes of theStartDate to 0 ¶ set seconds of theStartDate to 0 ¶ set theEndDate to theStartDate + (1 * hours) ¶ tell application \"Calendar\" ¶ tell calendar \"Home\" ¶ make new event with properties {summary:\"" & $TempName & "\", start date:theStartDate, end date:theEndDate} ¶ end tell ¶ end tell" (line breaks added for readability). If you had followed the second option, you would have: Let ( template = "set theStartDate to (current date) + («tempdays» * days) ¶set hours of theStartDate to 15 ¶set minutes of theStartDate to 0 ¶set seconds of theStartDate to 0 ¶set theEndDate to theStartDate + (1 * hours) ¶tell application \"Calendar\" ¶tell calendar \"Home\" ¶make new event with properties {summary:\"«tempname»\", start date:theStartDate, end date:theEndDate} ¶end tell ¶end tell" ; Substitute ( template ; [ "«tempdays»" ; $TempDays ] ; [ "«tempname»" ; $TempName ] ) ) -- Please note that I did not test your original AppleScript.
November 6, 20205 yr Author Newbies Many Thanks for the reply. I will try again tomorrow Regards Colin
November 8, 20205 yr Author Newbies Hi. Sorted out the problem using method 2. Great-Many Thanks for the help. Is there a possibility of transferring a message along with the create event to put into the notes section Colin
November 8, 20205 yr 1 hour ago, Colin Yorkshire said: Is there a possibility of transferring a message along with the create event to put into the notes section Not sure what that means exactly. You can pass any data to the AppleScript using one of the methods suggested above. Edited November 8, 20205 yr by comment
November 8, 20205 yr Author Newbies Yes, I understand that but I’m trying to find out what the field names are for calendar so I can specify it in the apple script. did a lot of searching but couldn’t find anything specifying the notes field
November 8, 20205 yr I still don't understand your question. It seems to be more about the Calendar application than about Filemaker. If you need to know how to make AppleScript do something in Calendar, open the Calendar's dictionary in Apple's Script Editor. Edited November 8, 20205 yr by comment
Create an account or sign in to comment