• 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: No permission to save file dialog in OS X Lion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No permission to save file dialog in OS X Lion


  • Subject: Re: No permission to save file dialog in OS X Lion
  • From: Ron Hunsinger <email@hidden>
  • Date: Fri, 29 Jul 2011 03:08:02 -0700


On Jul 28, 2011, at 5:46 PM, Brian Christmas wrote:

For a start, TextEdit no longer allied files to be save under the .txt name extension.

Well, actually it will.

You cannot save a rich-text document with a .txt name extension. To get a .txt extension, you have to save it as plain text.

If you specify a format, TextEdit insists that you also supply a destination filename. It's dictionary, however, lies. It says the destination must be an alias. That can't be right; you can only have an alias to an existing item, and you probably want to save to a new file.

Oddly enough, what it really wants is a POSIX path. (The clue is that "path of document 1" returns a POSIX path.)

set itsFldr to (path to documents folder as text) & "Unimportant_:"
set itsName to "TEDoc4.txt"
tell application "TextEdit"
save document 1 as "public.plain-text" in POSIX path of (itsFldr & itsName)
end tell

This is really a "save a copy…" operation. If the document was unsaved in TextEdit, it still is. If it has been saved, it's still based on that file.

I couldn't find a way (short of UI scripting) to convert the front document to Plain Text. Even with UI scripting, I couldn't find a way to find out the document's current format, so there's no way to know if you have to simulate a command-shift-T to switch formats or not. If the document has already been saved, you could look at it's path and get the extension from that, but if it hasn't been saved the path is still "missing value".

I suppose you could tell TextEdit to close document 1 without saving, and then re-open the .txt file you just saved.
 _______________________________________________
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: No permission to save file dialog in OS X Lion
      • From: "Zavatone, Alex" <email@hidden>
References: 
 >No permission to save file dialog in OS X Lion (From: email@hidden)
 >Re: No permission to save file dialog in OS X Lion (From: Brian Christmas <email@hidden>)

  • Prev by Date: Problems with pasting ole object into MS Word
  • Next by Date: Mail in Lion
  • Previous by thread: Re: No permission to save file dialog in OS X Lion
  • Next by thread: Re: No permission to save file dialog in OS X Lion
  • Index(es):
    • Date
    • Thread