Title: Re: Pdf-script
On 2/17/03 12:46 PM, "Paul van den Hooven" <[EMAIL PROTECTED]> wrote:

Hi.

I installed the OSX 10.2.4 updater and found out about the PDF workflow on the AppleScript site. Seemed kinda nice to start exploring AppleScript, so I copied the script on that page, and entered Microsoft Entourage instead of Mail. The script is:

on open these_items
   tell application "Microsoft Entourage"
        set the new_message to (make new outgoing message with properties {visible:true})
        tell the new_message
           tell content
               repeat with i from 1 to count of these_items
                   set this_file to item i of these_items
                   make new attachment with properties {filename:this_file} at before the first character
               end repeat
           end tell
       end tell
   end tell
end
open

I saved it as a compiled script.

When using the script the application I print from crashes. Is there something wrong with this script?

Everything. Each scriptable application has its own "vocabulary" defined in its own Dictionary, which you can view in Script Editor.

1. Entourage's 'outgoing message' class does not have  'visible' property.

2. You don't make attachments to Entourage messages that way - there is no 'filename' property, although there is a similar 'file' property.

3. Entourage does not have anything even vaguely resembling the obscene appalling syntax of Mail's '
at before the first character'. That's enough to crash any application except these AppleScript-illiterate new iApps. It makes me shudder to even read it.

Try this:

on open these_items
   tell application "Microsoft Entourage"
        activate
       set the new_message to (make new draft window)
        repeat with i from 1 to (count these_items)
            set this_file to item i of these_items
           make new attachment at the new_message with properties {file:this_file}
        end repeat
   end tell
end
open
'

And DON'T save it as a compiled script. You have to save it as an application, so you can drag and drop a group of files (or just one) on it.


--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: http://www.entourage.mvps.org/toc.html

PLEASE always state which version of Entourage you are using - 2001 or X. It's often impossible to answer your questions otherwise.

Reply via email to