• 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
Problem saving a new file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem saving a new file


  • Subject: Problem saving a new file
  • From: Eric Robertson <email@hidden>
  • Date: Fri, 19 Oct 2012 14:54:27 +0100

I'm a newbie and I'm having problems saving some data away to a new file. I've tried various things but the nearest I've got to doing this was the following:

tell application "TextEdit"
set newFile to "/Users/ericrobertson/Documents/New Notes.rtf"
activate
make new document with properties {path:newFile}
set text of document "New Notes.rtf" to "This is sample text"
save document "New Notes.rtf"
end tell

However although the document appears OK inTextEdit with the text included in it I get the message that I don't own the document "New Notes.rtf" and don't have permission to write to it. Do I have to set the file permissions in some way? I did try setting the name property as well as the path but this made no difference as it seemed to derive the name from just the path.

Incidentally i did find that if I just set the name property the path was set to /Users/ericrobertson/Library/Containers/com.apple.TextEdit/Data/Users/ericrobertson/Documents/New Notes.rtf.

I'm still on Lion (10.7.5) using TextEdit v1.7.1.

Eric Robertson


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Problem saving a new file
      • From: "koenig.yvan" <email@hidden>
    • Re: Problem saving a new file
      • From: "koenig.yvan" <email@hidden>
  • Prev by Date: Re: What's in a word
  • Next by Date: Re: Problem saving a new file
  • Previous by thread: rép: What's in a word
  • Next by thread: Re: Problem saving a new file
  • Index(es):
    • Date
    • Thread