This is working very well for me. I've tried modifying it to create another
script that will generate a note that contains a listing of only those
projects that have no tasks associated with them, but to no avail.
I'm guessing it has to do with this line in the original script:
set theProjects to name of every project
But am not sure how to only grab task-less projects.
Unfortunately this is not simple. 'project' as a class is very minimally
scriptable. You'll notice that the dictionary does not show any elements for
class 'project'. A proper implementation would show tasks, events, contacts,
groups and notes (and hopefully even 'file references' and 'clipping
references') as elements of a project - just as they appear to be in the UI
of projects in the Project Center. Then we would be able to say something
like
every project where its tasks = {}
but we can't do that since projects - in AppleScript - don't have tasks, nor
any other element.
So the first thing you should do, PLEASE, is to send a feedback via the Help
menu to request better scriptability of 'project' such that you can get all
the items of a project as elements.
Projects, instead, are only findable as items of the 'project list' property
of the individual Entourage objects which happen to belong to the project :
the other way around. That means that you have to trick Entourage to avoid
doing a very tedious repeat loop through all objects in Entourage. This
trick, still somewhat tedious, should work:
tell application "Microsoft Entourage"
set projectsWithoutTasks to {}
set allProjects to every project -- not name
repeat with i from 1 to (count allProjects)
set theProject to item i of allProjects
set projectTasks to (every task whose project list contains
{theProject})
if projectTasks = {} then set end of projectsWithoutTasks to name of
theProject
end repeat
projectsWithoutTasks
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.