• 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
Defaults read without error in script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Defaults read without error in script


  • Subject: Defaults read without error in script
  • From: Paul Cook <email@hidden>
  • Date: Tue, 07 Aug 2012 22:26:01 -0500

I'm trying to make a payload-free package to run a script. Amazingly, the problem seems to be with the script. I want to read a Mac OS X user default. But if the default doesn't exist, I get an error such as below.

**************
***************
$ defaults read  -g key
2012-08-07 22:17:46.115 defaults[2394:903]
The domain/default pair of (kCFPreferencesAnyApplication, key) does not exist
**************
***************

For me, this seems to be a "catch 22" as I can't figure out if it has a value without reading it first. Does anyone know how to do this without getting an error if it doesn't exist?

Best Wishes,

Paul


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Defaults read without error in script
      • From: Greg Neagle <email@hidden>
  • Prev by Date: Installer and pkgbuild brain dump
  • Next by Date: Re: Defaults read without error in script
  • Previous by thread: Installer and pkgbuild brain dump
  • Next by thread: Re: Defaults read without error in script
  • Index(es):
    • Date
    • Thread