Outrageously slow AppleScript performance
Bill Vlahos
bvlahos at mac.com
Tue Sep 30 20:55:07 EDT 2014
When I execute the AppleScript listed below in the AppleScript Editor it works in about 1 second. Take the same script, put in in a LiveCode field and do field “name” as AppleScript and it takes between 1 and 2 minutes to do!
1. Why?
2. How can I make it run quickly?
Here is the AppleScript. It makes an event at the date and time and gets info on it so that it is ready to add addresses and send out. The finished stack will show how to modify the newly created meeting and delete it. I plan on doing the same functions for Outlook on the Mac as a way to compare them.
set calendarName to "Work"
set theSummary to "Title of the event goes here 0775-4944"
set theDescrption to "Description of event goes here."
--set theLocation to ""
set startDate to "October 1, 2014 9:30:00 AM"
set endDate to "October 1, 2014 1:00:00 PM"
set startDate to date startDate
set endDate to date endDate
tell application "Calendar"
activate
tell (first calendar whose name is calendarName)
set vEventInfo to make new event at end of events with properties {summary:theSummary, start date:startDate, end date:endDate, description:theDescrption}
copy uid to cID --
copy vEventInfo's uid to eID --this works
save
end tell
reload calendars
view calendar at startDate
show vEventInfo
end tell
set the clipboard to eID
--display dialog "Event " & eID & " of Calendar " & cID
tell application "System Events"
tell process "Calendar"
keystroke "i" using command down
end tell
end tell
Bill Vlahos
_________________
InfoWallet (http://www.infowallet.com) is about keeping your important life information with you, accessible, and secure.
lcTaskList: (http://www.infowallet.com/lctasklist/index.htm)
RunRev lcTaskList Forum: (http://forums.runrev.com/viewforum.php?f=61)
More information about the use-livecode
mailing list