On 6/30/10 4:49 AM, "David Shulman" <[email protected]> wrote:

>Hi I have simple applescript
>
>activate application "Microsoft Entourage"
>set filepath to "Macintosh HD:Users:test:del2pdf"
>tell application "Microsoft Entourage"
>set newMessage to make new draft window
>make new attachment at newMessage with properties {file:filepath}
>end tell

I think Diane's suggestion to use Automator is best for something like
this. Just thought I'd point out some things in your script. The shorter a
script can be, the better and the easier to troubleshoot.

First, you're calling Entourage twice, once to "activate" it or bring it
forward and again to create a new message. You really only need to do this
with one "tell" statement.

 tell application "Microsoft Entourage"
  activate
  set newMessage to make new draft window
  make new attachment at newMessage with properties {file:filepath}
 end tell

The "set" statement can be either within or outside of the "tell"
statement.

I'm not quite sure how you're calling the the script. Are you using VBA or
a shell script to open the Script Editor each time, enter the script and
run it? If you don't want to use Automator then you may want to save the
AppleScript as an application itself and call that. If you're creating a
shell script then you may want to consider using the "osascript" command
for running your AppleScript syntax.

-- 

William Smith


--
YouTalk mailing list
List information: http://nine.pairlist.net/support_options/list.html
List moderator: [email protected], [email protected]
To unsubscribe: mailto:[email protected]?subject=unsubscribe

Reply via email to