简体   繁体   中英

Apple script not working on Mavericks with Microsoft outlook

I am trying to execute a simple Apple script on Mavericks but its not executing. The error i am facing is "expected end of line but found class name"

tell application "Microsoft Outlook"
    set currentTime to (the current date)
    set newEvent to make new calendar event with properties{subject:"New Appointment", start time:(currentTime + (60 *60)/2), end time:(currentTime + (60 * 60) +(60)/2)}
    open newEvent
end tell

I tried removing the duplicate dictionaries by running the command

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

Rebooting the Mac , Re Installing the outlook and Reinstalling Mavericks as well but still the same problem.

Can some one please suggest me any fresh ideas i'm totally out of all.

Thanks, Ravi.

It almost just looks like your script isn't properly delimited with line endings.

tell application "Microsoft Outlook"
    set currentTime to (the current date)
    set newEvent to make new calendar event with properties {subject:"New Appointment", start time:(currentTime + (60 * 60) / 2), end time:(currentTime + (60 * 60) + (60) / 2)}
    open newEvent
end tell

It should look like that.

Just a formatting note... it should look like this:

set currentTime to (the current date)
set startTime to currentTime + (30 * minutes) -- + 30 minutes
set endTime to currentTime + (1 * hours) + 30 -- + 1 hour 30 seconds

tell application "Microsoft Outlook"
    set newEvent to make new calendar event with properties {subject:"New Appointment", start time:startTime, end time:endTime}
    open newEvent
end tell

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM