Re: Error -43 when attempting to write to file
Re: Error -43 when attempting to write to file
- Subject: Re: Error -43 when attempting to write to file
- From: Gnarlodious <email@hidden>
- Date: Tue, 16 Nov 2004 18:05:10 -0700
Title: Re: Error -43 when attempting to write to file
I would probably throw up my arms in despair and say:
do shell script "echo " & quoted form of myText & " >>$HOME/" & theTargetFile
-- Gnarlie
Entity Aaron Rosenblum spoke thus:
> Hey all,
>
> I wrote this code to write lines to an output file.
>
> I have a property defined at the top of my script:
>
> property theTargetFile : (((path to home folder as string) &
> "output.txt") as string) as file specification
>
> and then I have this subroutine that logs lines to a file:
>
> on log_to_file(myText)
> try
> open for access theTargetFile with write permission
> write (myText) to theTargetFile starting at eof
> close access theTargetFile
> on error errMsg number errNum from objErr partial result errList to
> errClass
> display dialog errMsg & ". Error number: " & errNum & " in
> log_to_file function" giving up after 3
> end try
> end log_to_file
>
> It is generating the error: "File output.txt wasn't found.. Error
> number: -43" when some of my users run the script. However, when I run
> it on my laptop it works fine. Any ideas on why this is happening? Am
> I creating/setting access to this file the right way? Can I not define
> this stuff in a property?
>
> thanks
>
> Aaron
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> nk.net
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden