Re: Defaults read without error in script
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