Hi all,
I’m finally getting down to finding some new solutions to the scripting environment imposed as from Mavericks and Yosemite in regard to Calendar scripting - your recent feedback (dressing the process by ID to assure cross-OS compatibility) was promising but didn’t live up to my expectations.
I do notice one thing to start off this: creating an event takes up to 39 seconds (Whaaa?).
Is this a behaviour you also notice? Please note that our calendars are synced over iCloud - which might be part of the answer.
Secondly, because the search for a particular term is sooooooo lame (I used to search a number generated from our Filemaker solution previously), I have decided to go for a more integrated approach using the Calendar app’s UIDs.
For this to work, I will need to to parse the result, which returns as such:
event id "0105626A-2B1A-4738-A2D6-0F0CDF6619B8" of calendar id "8AAA0533-87C5-4E5E-A087-ABA983BEDB47”.
Impossible for the moment to find a way of parsing the result back into text to throw it back into Filemaker for future use. Any ideas?
Many thanks in advance for your input. And quite nice to be back in the game and reading you again.
J.
Hello Jay
Here is my well known quick and dirty tip.
tell application "Calendar"
set anEvent to first event of (get calendar 2)
try
anEvent * 2 # will always issue an error
on error errMsg number errNbr
log errMsg (*Impossible de convertir «class wrev» id "2497f734-dad7-370f-8899-4a1fc0eb49ee" of «class wres» id "B14C3AF8-9317-4B34-A7D6-2CDAE576D03E" of application "Calendar" en type number.*)
set maybe to my decoupe(errMsg, quote)
set eventID to item 2 of maybe
log result (*2497f734-dad7-370f-8899-4a1fc0eb49ee*)
set calendarID to item 4 of maybe
log result (*B14C3AF8-9317-4B34-A7D6-2CDAE576D03E*)
end try
end tell
#=====
on decoupe(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
#=====
Yvan KOENIG (VALLAURIS, France) lundi 21 septembre 2015 22:35:45