我正在尝试使用outlook中的apple scrip创建一个新事件,但我不知道为什么会出现此错误。
--read source from the file
set theFile to "/Users/eclit/Documents/Microsoft User Data/Office 2011 Identities/Main Identity/Data Records/Template/MeetingTemplate.html"
open for access theFile
set fileContents to (read theFile)
close access theFile
on replaceText(find, replace, subject)
set prevTIDs to text item delimiters of AppleScript
set text item delimiters of AppleScript to find
set subject to text items of subject
set text item delimiters of AppleScript to replace
set subject to "" & subject
set text item delimiters of AppleScript to prevTIDs
return subject
end replaceText
on categoryForName(_categoryName)
tell application "Microsoft Outlook"
try
return category _categoryName
on error
try
-- Getting by name doesn't always work.
repeat with _category in categories
if _category's name is _categoryName then return _category
end repeat
end try
make new category with properties {name:_categoryName}
end try
return category _categoryName
end tell
end categoryForName
tell application "Microsoft Outlook"
set currentTime to current date
set theCategory to my categoryForName("Work")
set newEvent to make new calendar event with properties {subject:"Dial In : +442034333797, Conference code: 4754632380", start time:currentTime, end time:(currentTime + (24 * 60 * 60 * 1)), content:fileContents}
open newEvent
end tell
在fileContents
我收到了数据,但事件未创建。