[bash] exploring preferences

Joined
Feb 2, 2009
Messages
3
Reaction score
0
Points
1
Your Mac's Specs
intel iMac, iTouch, older toys + PC's
Hi all-

Quick question - I turned up an interesting tidbit (that changing the values of com.apple.Safari TargetedClicksCreateTabs can force safari to use one window instead of opening new windows constantly) and I'm trying to write a little script to toggle that sucker on and off. As I was working, I discovered I don't really know how to work with com.apple.foo stuff - specifically, I'd like to be able to see and set the value of a parameter from bash - how would I do that? I know this isn't strictly necessary to write the script, it's just something I'd like to know.

A second question would also be, how do I list the contents of these files - I'd love to see what other hidden configuration options there are lurking in my machine!

Thanks,
Erom
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
if you wanted to say.. toggle your screen capture modes.. (and I wanted to do this) you'd do something like

The command is as follows:
defaults write com.apple.screencapture type jpg && killall SystemUIServer

if you wanted a simple command you could do something like

echo 'alias ssJpg="defaults write com.apple.screencapture type jpg && killall SystemUIServer"' >>.profile

then you can just issus ssJpg and have it change to jpg. Make sense?
 
OP
E
Joined
Feb 2, 2009
Messages
3
Reaction score
0
Points
1
Your Mac's Specs
intel iMac, iTouch, older toys + PC's
Make sense?

Yes! Thank you. I was also wondering how I would, say, display the current value of com.apple.screencapture without changing it

echo "com.apple.screencapture type"

doesn't seem to do it. Thanks again,

Erom
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Here you go..

Code:
mikeMbp:~ mike$ defaults read com.apple.screencapture
{
    type = png;
}
mikeMbp:~ mike$
 
OP
E
Joined
Feb 2, 2009
Messages
3
Reaction score
0
Points
1
Your Mac's Specs
intel iMac, iTouch, older toys + PC's
Ooooh! Thanks! Rep+

Am I supposed to mark this thread solved in some way or do you guys do that here?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top