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