• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problems Writing to a File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Problems Writing to a File
      • From: Steve Suranie <email@hidden>
References: 
 >Problems Writing to a File (From: Steve Suranie <email@hidden>)

  • Prev by Date: Re: Adding additional headers to new outgoing Mail message?
  • Next by Date: Re: Problems Writing to a File
  • Previous by thread: Re: Problems Writing to a File
  • Next by thread: Re: Problems Writing to a File
  • Index(es):
    • Date
    • Thread