I have version 11.2.3 but it does not automatically convert tasks to events.
Does anyone have an Applescript to do this?
You haven't said how long you want the events to last. In the script below
they are set to one hour - 60 minutes. You can change that to anything -
including even 0 but then they wouldn't show up on the calendar. I presumed
you really wanted to convert the task to an event, as you say, so the script
deletes the task. If you want to keep it, remove that line and remove the
"--" before the following line so it would link the new event to the task.
There's no way to convert a no-due-date-task to an event (when should it
start?) so the script will alert you and open those tasks at the end for you
to add a due date if you wish and run the script again. Otherwise it tells
you when it's done (you could remove that notice if you wish, after the
'else'.)
I just discovered an Entourage bug: if you ever had a task with a reminder
which you dismissed but did not mark as "Complete", the reminder disappears
from the task in the Tasks List and in the task itself in the UI, but
AppleScript still has it marked as 'has reminder:true". So those tasks will
create reminders for the converted events. But if you're not converted any
past tasks, only new ones, this situation should not arise. I'll report the
bug.
tell application "Microsoft Entourage"
try
set theTasks to selection
if theTasks = {} then error number -128
on error
beep
display dialog "First select some tasks in the Tasks List or a
custom view." buttons {"Cancel"} default button 1 with icon 2
end try
set noDueDateTasks to {}
repeat with theTask in my theTasks
repeat 1 times
if class of theTask is task then
set {theTitle, theDueDate, hasReminder, remindTime,
isRecurring, theNotes, theCategories, theProjects, theLinks} to theTask's
{name, due date, has reminder, remind date and time, recurring, content,
category, project list, links}
if theDueDate is date "1/1/1904" then
set end of noDueDateTasks to theTask
exit repeat -- skip to next task
end if
if isRecurring then set theRecurrence to recurrence
if hasReminder then
set theReminder to ((theDueDate - remindTime) div 60)
--in minutes
if theReminder < 0 then set theReminder to 0 -- no
"future" remindrs for events
end if
set theEndTime to theDueDate + (60 * minutes) -- or adjust
for standard length of converted event
if isRecurring then
set newEvent to make new event with properties
{subject:theTitle, start time:theDueDate, end time:theEndTime, has
reminder:hasReminder, recurring:true, recurrence:theRecurrence,
content:theNotes, category:theCategories, project list:theProjects}
else
set newEvent to make new event with properties
{subject:theTitle, start time:theDueDate, end time:theEndTime, has
reminder:hasReminder, recurring:false, content:theNotes,
category:theCategories, project list:theProjects}
end if
if hasReminder then set remind time of newEvent to
theReminder
repeat with theLink in theLinks
link newEvent to theLink
end repeat
delete theTask -- if you really want to replace it, or else
:
-- link newEvent to theTask -- if you want to keep it
end if
end repeat -- 1 times
end repeat
if noDueDateTasks ‚ {} then
beep
display dialog "You include task(s) that have no due date, which
cannot be converted to events." & return & return & "They will open now so
you can add a due date which will become the start time of an event if you
then close them, select them, and run teh script again." buttons {"OK"}
default button 1 with icon 2
open noDueDateTasks
else
beep
display dialog "Done!" & return & return & "Your selected tasks have
been converted to events starting at the tasks' due dates." buttons {"OK"}
default button 1 with icon 1
end if
end tell
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.