Re: Problems Writing to a File
Re: Problems Writing to a File
- Subject: Re: Problems Writing to a File
- From: Michelle Steiner <email@hidden>
- Date: Thu, 10 Nov 2005 11:53:58 -0700
On Nov 10, 2005, at 11:20 AM, Steve Suranie wrote:
set theFilePath to (path to desktop) &
"archiveTool:htmlFiles:tempFile.txt"
as string
set theContent to "This is a test"
my writeFile(theFilePath, theContent)
on writeFile(theFilePath, theContent)
tell application "Finder"
set f to (open for access theFilePath with write permission)
write theContent to f
close access f
end tell
end writeFile
I get an error message in the subroutine telling me the Finder
cannot find
the file. I've tried open for access file theFilePath, open for
access alias
theFilePath, wrapping it in a tell application "Finder" call and I
still get
the same error.
Once I created the required nested folders on my desktop, your code
worked with modifications; I removed the Tell block (it is not
required).
Double check your original code to ensure there are no typos in the
string containing the path name.
--
My choice early in life was either to be a piano-player in a
whorehouse or a politician. And to tell the truth, there's hardly
any difference.
-- Harry S. Truman (circa 1962)
_______________________________________________
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