Re: boldly creating files where no file has been created before (or not...)
Re: boldly creating files where no file has been created before (or not...)
- Subject: Re: boldly creating files where no file has been created before (or not...)
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 24 Jan 2002 18:22:35 -0800
On 1/24/02 5:25 PM, "has" <email@hidden> wrote:
>
My brain is pretty much toast at this point, so for once I'm going to take
>
the easy (if shameful and embarrassing) option and just ask the list
>
instead. (Even if it does make me look like an ignorant newbie.)
>
>
The following code works fine for me (AS 1.3.7, OS 8.6). My daring and
>
courageous tester, however, reports that it fails on their system (AS 1.6,
>
OS 9.1).
>
>
======================================================================
>
>
on saveScript(filePath, scriptObj)
>
try
>
store script scriptObj in filePath replacing yes
>
true
>
on error errormsg number errorNumber
>
error "Couldn't save script file " & filePath & " due to error:
>
" & errormsg number errorNumber
>
end try
>
end saveScript
>
>
======================================================================
>
>
The filePath parameter is a string: "Saphir:Desktop
>
Folder:AWPS:TemplateObjFolder:test TemplateObj"
>
>
The scriptObj parameter is, not surprisingly, a script object.
Usually reason - you have Jon's Commands and/or Akua, and your tester
doesn't. Nothing to do with the OS.
store script scriptObj in filePath replacing yes
Scripts aren't stored in string file paths, they're stored in aliases:
store script scriptObj in alias filePath replacing yes
Jon's or Akua is coercing string filePath to alias filePath on your
computer.
>open for access logFilePath with write permission
Same story: needs ' file', not a string path.
open for access file logFilePath with write permission
It's happened to all of us...
--
Paul Berkowitz