On 8/7/03 8:50 PM, "Russell" <[EMAIL PROTECTED]> wrote:

> I'm using 10.2.3.
> 
> Here's the segment of the script:
> 
> 
> on writefile(s, subj)
>   try
>       tell application "Finder" to activate
>       set p to "10:Desktop:digest:"
>       set fn to makeName(subj)
>       set fileRef to open for access (file (p & fn)) with write permission
>       write s to fileRef
>       close access fileRef
>       tell application "Finder"
>           activate
>           set the file type of file (p & fn) to tcode
>           set the creator type of file (p & fn) to ccode
>       end tell
>   on error theErr
>       display dialog theErr
>   end try
> end writefile


The main thing is that in OS X the Desktop is not a folder on your hard disk
("10:"); it's a folder in your user folder ("10:Users"username:").  In both
OS 9 and X the best way to specify it is

    path to desktop as Unicode text --or 'as string'

You also don't need to activate the Finder at all, certainly not twice. If
you really want the file to come to the front at the end of the script
however, then you can reveal it after activating the Finder. (It will
display it in the desktop as folder rather than on your real desktop, min
you. You can just omit those lines at the bottom.)


on writefile(s, subj)
    try
        set p to path to desktop as Unicode text
        set fn to makeName(subj)
        set fileRef to open for access file (p & fn) with write permission
        write s to fileRef
        close access fileRef
        tell application "Finder"
            set the file type of file (p & fn) to tcode
            set the creator type of file (p & fn) to ccode
            --omit next two lines if not needed
            activate
            reveal file (p & fn)
        end tell
    on error theErr
        display dialog theErr
    end try
end writefile



-- 
Paul Berkowitz
MVP Entourage


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

-- 
To unsubscribe:                     
<mailto:[EMAIL PROTECTED]>
archives:       
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:       
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to