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

Re: Defaults read without error in script


  • Subject: Re: Defaults read without error in script
  • From: Greg Neagle <email@hidden>
  • Date: Tue, 07 Aug 2012 22:20:26 -0700

You can't. So catch and handle the error appropriately.

-Greg

On Aug 7, 2012, at 8:26 PM, Paul Cook <email@hidden> wrote:

> 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

 _______________________________________________
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

References: 
 >Defaults read without error in script (From: Paul Cook <email@hidden>)

  • Prev by Date: Defaults read without error in script
  • Next by Date: Version No. info for MetaPackage
  • Previous by thread: Defaults read without error in script
  • Next by thread: Version No. info for MetaPackage
  • Index(es):
    • Date
    • Thread