This is adapted from a working attachment stripper for mails. Has been adapted to do calendar appointments instead:
set attachmentSizeOfNote to 10000 -- this is in KB. Change this if you feel it's too small.
display dialog "Open Outlook and Select the folder (of calendar) you wish to clean. Once done, click OK to continue"
tell application "Microsoft Outlook"
set thisCalendar to calendar "Calendar"
set allmail to every calendar event of thisCalendar
repeat with theMsg in allmail
set msgAttachments to attachments of theMsg
repeat with i from (count msgAttachments) to 1 by -1
set theAttachment to item i of msgAttachments
set theAttachmentSize to file size of theAttachment as integer
set KSize to (theAttachmentSize / 1024)
if KSize is greater than attachmentSizeOfNote then
beep
set theAttachmentName to name of theAttachment
set results to display dialog "Do you wish to delete " & theAttachmentName & " which is " & KSize & " K big?" buttons {"Yes", "No"}
set answer to button returned of results
if answer is equal to "Yes" then delete theAttachment
end if
end repeat
end repeat
end tell
It returns 0 events, which is not true. Any ideas?
Despite not being able to see any local calendars, there’s obviously one there…
Used:
tell application "Microsoft Outlook
set thisAccount to exchange account "Mailbox - Woggledog"
set thisFolders to calendar of thisAccount
end tell
(Available from Outlook > Preferences > Accounts… I could have done it systematically too…
This returns:
{calendar id 130 of application “Microsoft Outlook”}
So, in my script, I can now use
set thisCalendar to calendar id 130
I did something similar yesterday, which listed two entries. I though nothing of it, actually thinking it was an error in my code, because both were called “Calendar” and had IDs of 13 an 130. It was obviously late in the day and I read both as 130.
Now working in full. In case of there being multiple accounts, it goes off and gets them for you, then, in the case of multiple calendars, it gets those too!