Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [defaults]

defaults(1) is a Mac OS console application used to manage user preferences stored in property list files.

1
vote
1answer
19 views

Can I set a specific Time zone for an app in macOS?

In macOS, I can use the code below to set specific language for Word.app, can I use some similar code to set a specific Time zone for an app? defaults write com.microsoft.Word AppleLanguages '("de")'
0
votes
0answers
16 views

Enforce 2 security settings on Mojave

I would like to enforce the "require password immediately after sleep or screen saver begins" option via terminal on macOS Mojave. However, I am having trouble with finding the time setting with ...
0
votes
1answer
31 views

How to change default app to open magnet:// link without using a third-party UI app?

How to change default app to open magnet:// link without using a third-party app? I knew I maybe could use RCDefaultApp to do it but I am trying to figure out how to do it without installation of ...
1
vote
1answer
36 views

How to revert this defaults write command?

defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes It is related to this question: How can I disable inline attachment previews (i.e. view as icon by default) in Mac Mail in ...
1
vote
1answer
22 views

What is 'currentHost' for, in defaults?

There are many webpages given over to listing defaults commands in order to configure various parts of the OS. Some of them include the flag -currentHost. The man page for the defaults command ...
1
vote
1answer
34 views

How can I script the keyboard backlight settings?

I'm looking to change settings with a script, but I can't find where the plist data for the keyboard backlight settings is stored. For example, in the System Preferences, I'd like to modify the ...
1
vote
1answer
19 views

Do macOS default preferences ever have breaking changes (the ones we edit with defaults command)?

I have a script that uses the defaults command to set a bunch of preferences. I am curious, do these preferences ever have breaking changes (f.e. when I update macOS), so that I need to modify my ...
0
votes
0answers
25 views

Problem in defaults command when adding app with blanks in name to dock

I would like to add an app to my dock via a command. I'm able to add an icon to the dock when there are no blanks in the path. I get an error message when I have a blank in the path. The command ...
1
vote
1answer
37 views

How to stop macOS from asking if I want to set a default browser?

Is there a mechanism I could disable to get rid of the dialog every time I run a new browser on macOS?
8
votes
1answer
2k views

How can I disable inline attachment previews (i.e. view as icon by default) in Mac Mail in macOS Mojave?

I would like to disable inline attachment previews by default, and instead view all attachments as icons in Mac's Mail app in macOS Mojave. In High Sierra, the following terminal command was ...
10
votes
2answers
2k views

How to access a launch daemon's values/ system defaults value

So I am trying to silence the "Your Disk is Almost Full" notification from a mac running Mojave, as right now it pops up way too frequently and it is so annoying. I followed all answers from this ...
3
votes
2answers
384 views

Is there a macOS equivalent of the Windows assoc command?

I am looking to change a file association on the Mac using some sort of script. I know that I can do something like that in Windows using the assoc command. Is there something scriptable on macOS ...
2
votes
1answer
31 views

Why doesn't “su - user -c defaults read” work?

I'm writing a script to set a defaults preference for all users on a machine. When I run it from a root shell, the defaults command runs as if it's been given incorrect arguments. bash-3.2# su - ...
2
votes
0answers
290 views

On MacOS is there a way to change all Finder background images for icon view back to default?

Just upgraded to Mojave and am using dark mode but I realise that many of the Finder windows have a background set to a light background that does not match the new Mojave look. I can go into the ...
2
votes
0answers
538 views

Apple Remove Dock Icon with a command line

I'm trying to find the terminal command which can remove an icon from the dock, but I can't find the solution. I tried the defaults read / defaults write command but it doesn't seem to have the ...
1
vote
1answer
132 views

Changing the default folder for opening a new Finder tab or window in macOS High Sierra?

When I press ⌘+T or ⌘+N in Finder to open a new tab or window, for some reason it always starts in this folder: /System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/...
1
vote
0answers
349 views

How to delete GameCenter and iCloud from Internet Accounts using the Terminal?

Running Sierra 10.12.6 without administrator privileges, the system has some problem with my iCloud profile. Whenever accessing anything remotely related to it, the respective app beachballs ...
1
vote
1answer
23 views

macOS Maps - any way to change the default starting point for navigation?

Is there a hidden setting to change the default starting point for Maps navigation away from "My Location"? The Problem: When I'm traveling, I frequently want to check the distance between two ...
1
vote
0answers
92 views

Disable AirDrop by writing DisableAirDrop to group com.apple.NetworkBrowser

I'd like to know if there's any difference in behavior when I try to set AirDrop off using sudo or as regular user : sudo defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES defaults ...
2
votes
0answers
18 views

System Preferences: Modification take effects instantly, how it works?

Any changes on System Preferences app take effect instantly. However, a kill is necessary for defaults command to take effect. I wonder how System Preferences app works and is it possible to force ...
0
votes
1answer
47 views

How to Reset all Drivers to Factory Default

I am trying to sync an Arduino board to my Mac and it was working fine until I installed some drivers. Now it can't find the serial port. How can I reset all drivers to the factory default?
0
votes
0answers
180 views

Using `defaults` through ssh: “Domain com.apple.dt.Xcode does not exist”

I'm trying to automate a build process, and as part of making things robust, I need to set some values with the defaults application. When I'm logged in locally using a terminal on the graphical ...
1
vote
2answers
76 views

Preferences changes using “defaults” not applied

I'm a CLI enthusiast and, as such, I've been a extensive user of brew, cask, m, mas, softwareupdate and so on. I've even written some tutorials about them (check here and there). Right now, I'm ...
0
votes
1answer
28 views

Resetting previously selected folder when selecting a file with Finder

I use a personal password manager and the database is protected by a password and you have to provide a key file. To select the key file you click a file selection dropdown. A Finder window pops up ...
0
votes
0answers
32 views

Sound default problem (can't mute internal speakers)

Basically, I am having problems with the sound always finding a way to come out of the speakers, which is annoying, in a work environment. I've removed all external audio devices and set the volume ...
7
votes
2answers
102 views

How can I find all the changes I've made to my system via “defaults write”?

Over time, I've made many tweaks to my OS using defaults write, for example: defaults write NSGlobalDomain KeyRepeat -int 0 defaults write NSGlobalDomain AppleShowScrollBars -string "Always" and so ...
3
votes
1answer
301 views

How to change multiple file type associations on the Mac at once?

I want to change my default media player in macOS. (In my case, I want to change it to my own AppleScript-created instance of VLC that I exported as ‘VLC-New-Window.app’, which is scripted to always ...
2
votes
1answer
50 views

“Open with” configuration gets screwed up unpredictably on El Capitan

I've been having a problem on my El Capitan installation for a few months. At unpredictable times, the system "unlearns" the programs associated with certain file types. For example, I double click a ...
2
votes
0answers
166 views

How to set the default editor for a Makefile?

I want to set the default text editor for Makefiles to something like Atom or Sublime Text to make them easier to open, and so that when I edit remote Makefiles through CyberDuck they will open in one ...
2
votes
1answer
54 views

How do people find out hidden UserDefaults [closed]

Quite often I come across these online posts about these hidden tricks that, usually entered it Terminal, access the user defaults system and overwrites/creates new defaults which are not normally ...
2
votes
1answer
2k views

How do I speed up the animation time for switching between desktop spaces? [duplicate]

Is there a way to speed up the animation time for switching between spaces? (Or maybe turning them off?). Preferably without buying a third party app. Maybe there's an option defaults. I'm on Sierra ...
0
votes
1answer
508 views

iTerm opens instead of default web browser when links clicked in Apple Mail

Clicking on links in Apple Mail (http or https, doesn't matter), opens a new iTerm 2 terminal session instead of my default browser. I can't figure it out. Weirdly, iTerm.app shows up as a potential ...
2
votes
1answer
208 views

Make preferences changes take effect immediately from CLI

How you can make changes take effect and update in the Preferences GUI immediately without having to reboot (unacceptable), log out (bad) or kill processes (last resort)? macOS 10.12 defaults write ~/...
3
votes
0answers
827 views

How to prevent default pdf viewer from being changed to iBooks

Every so often the default viewer for PDF files gets changed to iBooks. I want PDF files to be opened with Preview, and I want that setting to persist. I know how to manually change the default back ...
1
vote
1answer
38 views

How to run commands to turn off preview in Mail

I try to turn off automatic preview in Mail by following the advice in Turn off automatic preview in apple mail. But I don't know where to enter defaults write com.apple.mail ...
3
votes
1answer
450 views

“Open with” equivalent on Mac

I have a very simple problem and I thought the solution would be simple. However, I do not see any straightforward solution to this problem so far. I have a CSV file and in Windows world you can ...
11
votes
1answer
2k views

Can “defaults write” command line configure the menu bar on macOS?

I would really like to use a script to enable these things on macOS High Sierra, by using defaults. I know how to create the script in .bash_profile, as I will use a function for it, and then just run ...
2
votes
2answers
68 views

How to disable file associations to an app before/after installing?

I found this app that I needed to disable from association to music and video files that it's capable of opening, and the app doesn't have an option to disassociate filetypes. It's a media player, ...
3
votes
2answers
229 views

How to set a default folder when opening Finder

I am new on MacOS, would like to set a default folder to open Finder, instead of Recent items folder. I tried: defaults write com.apple.finder NewWindowTargetPath -string "file:///Users/path/to/...
1
vote
2answers
1k views

Jar Launcher.app : where is it supposed to be located at?

On Sierra I installed Java (JDK) and Parallels Desktop. The Windows VM I have in Parallels has decided to set its own (Windows) copy of Java as default for Mac .jar files, which means that whenever I ...
2
votes
1answer
133 views

How do I handle (e.g. correctly escape) parens in a 'defaults write …' key value?

TL;DR In defaults write <domain> <key> <value>, how do I provide a <value> that contains parens; i.e. "round" brackets, "(" and ")" ? Full Bhoona I'm using defaults to ...
4
votes
2answers
120 views

Set pagezoom of Safari programmatically

I recently bought a 4K monitor and love the screen real estate. But the standard fonts are becoming a bit too small to read. So I plan on writing a script in Keyboard Maestro to change the default ...
1
vote
1answer
337 views

Having trouble editing Finder settings using defaults write

I run the following command: sudo defaults write ~/Library/Preferences/com.apple.finder.plist ShowHardDrivesOnDesktop -boolean TRUE in hopes that this will cause system hard drives to show on the ...
4
votes
3answers
376 views

make textedit the default app for new file types [duplicate]

Often I download files with funny extensions, like .wnd, .npy, .dat, etc. Is there some way I can make the default app for all files like these, as in files that the system does not already recognize, ...
0
votes
1answer
2k views

How to change file icon based file's extension (.txt, .cpp, .docx, etc)

Desired result: All .py files show a nice Python icon, regardless of what default program they opened with. (Same for .cpp files, .txt files, etc) _ How it currently works: Files (ex: .py files) ...
3
votes
0answers
321 views

Open folder from terminal using Forklift

I'm often opening a folder from the terminal in Finder using open . or open ./thisfolder. I just switched from Finder to Forklift, set it as default file viewer via defaults write -g NSFileViewer -...
0
votes
1answer
783 views

Terminal command to list application defaults?

I'm new to Mac from the Linux world, and I am looking for a command or file providing a list to default user applications associated with certain filetypes. For example, on Linux: $ cat /usr/share/...
2
votes
1answer
1k views

Deleting entries in defaults

I have accidentally added an entry to my defaults (/usr/bin/defaults) that is preventing me from installing apps via iTunes. How do I undo my change? This is the command to read the offending entry: ...
3
votes
1answer
602 views

How to define an array with a single `defaults` command?

I want a domain com.apple.keyboard.modifiermapping.1452-628-0 to contain the following array: ( { HIDKeyboardModifierMappingDst = 2; HIDKeyboardModifierMappingSrc = 0; }, ...
1
vote
1answer
278 views

How to set permanent default applications on El Capitan

Every time I restart my mac book pro, all my settings of default applications change to factory default applications. For eg, I set adobe acrobat reader DC as my default PDF viewer, sublime text as ...