Title: Re: AppleScript to backup Entourage data
>>> Can’t set «class cfol» “Documents:Microsoft User Data” of «class sdsk» of
>>> application “Finder”
>>> to «class cfol» “Documents:Microsoft User Data” of «class sdsk» of
>>> application
>>> “Finder”.
>>
>> You see things like that when the script is looking for commands that your
>> system doesn't have.  It looks like your Finder isn't AppleScriptable, which
>> implies to me that you're running OS 8.5 or earlier.  Is that correct?
>>
>> Sorry -- I assumed that anyone using Office 2001 would be on a recent OS.
>> The script requires at least OS 8.6.  If you are on 8.6 or later, let me
>> know.

Chris's original email stated:
> I'm running AppleScript 1.5.5. Under OS 9.1, and Script Editor 1.5.5


>>> My files follow this pathway, but the “Documents” folder is an alias to the
>>> Documents folder on another HD. Would this matter?
>>
>> No -- you'd get a different error if it couldn't find the folder.  In this
>> case, it doesn't even understand that it's supposed to look for a folder.

It's not a case of not finding a folder, it's a case of not being able to appropriate coerce things.

Take the following:
   tell application "Finder"
      activate
      set theFolder to (folder "Documents:Microsoft User Data" of startup disk)
      if theFolder exists then
         open theFolder
      end if
   end tell

[By the by, might I suggest that you use something akin to the "set theFolder ..." line above.  It makes coding, debugging, and reading scripts ever so much easier. ;-)]


Anyhow.  The above script works fine.

#####

Take the following:
   tell application "Finder"
      activate
      set theFolder to (folder "Documents:Microsoft User Data" of startup disk)
      if theFolder exists then
         open theFolder as folder
      end if
   end tell

It generates the error:
Can't make «class cfol» "Microsoft User Data" of «class cfol» "Documents" of «class sdsk» of application "Finder" into a «class cfol».

And that would be under MacOS 9.1.

The only difference between the two:
   open theFolder as folder
A "failed coercion".

In your script, on Chris's system, you have some kind of implicit coercion that's failing.  I suspect that it's because of the alias issue...but I didn't really fully investigate that.

mikel

Reply via email to