• 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
Rép: TextEdit preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rép: TextEdit preferences


  • Subject: Rép: TextEdit preferences
  • From: Yvan KOENIG <email@hidden>
  • Date: Sun, 17 May 2009 20:38:32 +0200

Le 17 mai 2009 à 19:55, Philip Aker a écrit :

On 2009-05-17, at 10:45:37, Yvan KOENIG wrote:

defaults read com.apple.TextEdit RichText


Thanks but,
under 10.5.6 as well as under 10.4.11 it logically returns:

The domain/default pair of (com.apple.TextEdit, RichText) does not exist.


because it is trying to read a parameter in com.Apple.TextEdit.plist
but as I wrote, this parameter is NOT stored in this file.

When the key does not exist then the format is RichText.

This is a common behavior in Mac OS X because some preferences calls in CoreFoundation and Cocoa will return NULL if a key/value pair doesn't exist (instead of an error) and the developer will take that to mean "use the built-in default behavior".


OK

the entry is created only if we change the default setting.
I assumed that if we move back to the default setting the entry remains available with the value 1 but in fact is is deleted.


Checking that, I took care that if we change the setting, the plist is not updated until we quit the app.

So I can't rely on this setiing to check if a newly created document is a Rtf file.

I will go back to a test upon the menu item #4
with this code

tell application "TextEdit"
activate
make new document
set TEname to get name of document 1
tell application "System Events" to tell application process "TextEdit" to tell menu bar 1 to tell menu bar item 5 to tell menu 1
if name of menu item 4 contains "Rtf" then click menu item 4
end tell -- System Events
end tell -- TextEdit


The drawback is that I don't know if it's really spelled "Rtf" in every languages .

Yvan KOENIG (from FRANCE dimanche 17 mai 2009 20:29:29)






_______________________________________________ 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: Rép: TextEdit preferences
      • From: Philip Aker <email@hidden>
  • Prev by Date: Re: TextEdit preferences
  • Next by Date: Display Dialog with Title
  • Previous by thread: Re: TextEdit preferences
  • Next by thread: Re: Rép: TextEdit preferences
  • Index(es):
    • Date
    • Thread