How Do I Use AppleScript to Create a Entourage Project on the Fly

I want to use Entourage’s Project function as a mechanism for tagging emails and some tasks. However, the Project Center is overkill for what I want to do. I want to avoid the New Project wizard and create Projects on the fly with AppleScript. Does anyone know how to do this programmatically with a script?

I tried this:

tell application “Microsoft Entourage”
set theName to “My Test Project”
set newProject to make new project with properties {name:theName}
end tell

This creates a project, but it makes Entourage very unstable. My guess is that I am not including enough property parameters. Also, I need to be able to display a dialog box to the user to ask for the name of the project he or she wants to create.

I would be very grateful for any help you can offer.

Model: MacBook Pro
AppleScript: 1.10.6
Browser: Safari 417.9.3
Operating System: Mac OS X (10.4)

Try this:

tell application "Microsoft Entourage"
	make new project with properties {name:text returned of (display dialog "Enter project's name:" default answer "" with icon 1)}
end tell

It’s the same base code. What does it mean “unstable”? This works fine here…

I rebuilt my database and now it works. However, I am new to AppleScript. Can someone provide me with the commands to create a simple dialog box to ask the user for the name of the project and store the user’s response as a variable? Thanks!

set projectName to text returned of (display dialog "Enter project's name:" default answer "" with icon 1)

See the Standard Additions’ dictionary for more info on “display dialog” (and other useful commands). :wink:

After a little sleuthing and hacking, I ended up with this:

tell application "Microsoft Entourage"
	activate
	set theReply to display dialog "Please enter a project name:" default answer "[Project Name]"
	try
		set newProject to make new project with properties {name:theName}
	on error
		display dialog "Evidently, that project name has already been used. Please double-check and then try again." buttons {"OK"} default button "OK"
	end try
end tell

It seems to work well. Thanks for the help.

Oops. I didn’t see your reply before I replied! Here’s the final version:

tell application "Microsoft Entourage"
	
	activate
	
	set projectName to text returned of (display dialog "Enter project's name:" default answer "" with icon 1)
	
	try
		set newProject to make new project with properties {name:projectName}
		
	on error
		display dialog "Evidently, that project name has already been used. Please double-check and then try again." buttons {"OK"} default button "OK" with icon 1

	end try
	
end tell