• 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
setting a preference with do Shell Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setting a preference with do Shell Script


  • Subject: setting a preference with do Shell Script
  • From: KOENIG Yvan <email@hidden>
  • Date: Sat, 28 Jan 2012 17:41:02 +0100

Hello

I'm trying to use a script to change a preference setting.
It's the preference FormatXML dedicated to Pages, an iWork application.

The default setting is NO but I wish to set it to YES.

I thought that

do shell script "defaults write com.apple.iWork.Pages FormatXML -string YES"

would do the trick.

It seems to do because if I run

do shell script "defaults read com.apple.iWork.Pages FormatXML"

do shell script "defaults write com.apple.iWork.Pages FormatXML -string YES"

do shell script "defaults read com.apple.iWork.Pages FormatXML"


the log report claim :
--> "NO"
--> ""
--> "YES"

I did that with the application closed.

Alas, when I open the preference file, it contain the value NO.

It seems that a complementary action is required to force the change to be written on disk but I don't guess which one.

Of course it's not for my own use (I am able to use Property List Editor).
But it's for an asker which is afraid to enter in the file by hand.

Yvan KOENIG (VALLAURIS, France) samedi 28 janvier 2012 17:38:36


 _______________________________________________
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: setting a preference with do Shell Script
      • From: Doug McNutt <email@hidden>
  • Prev by Date: Re: Reformatting a string
  • Next by Date: Re: setting a preference with do Shell Script
  • Previous by thread: Re: Reformatting a string
  • Next by thread: Re: setting a preference with do Shell Script
  • Index(es):
    • Date
    • Thread