I believe I used the following Terminal command in Sierra or Hi Sierra to set Mail’s view as default to icon. But now in Mojave it seems to have no effect. I did restart Mail:
The paradigm nowadays is that you write to domains in the Defaults system, not to the plist files themselves. The system updates the files in due course, so it’s the system, not the files, which needs to know of any changes in the first instance.
I don’t know the setting for LouK’s query, but it’s not uncommon for unofficial preferences set with defaults write to be ignored in later versions of the operating system. Apple’s developers seem determined that you should eventually adopt what they think is a good idea, even if you don’t like it yourself. :mad: But I don’t use Mail, so I can’t say if that’s what’s happened here.
I think you got the syntax right. I’ve just Googled “DisableInLineAttachmentViewing” and got quite a few hits recommending exactly what you tried. Also complaints that it no longer works in Mojave. However, this thread on an Apple Communities forum describes a process which apparently gets it work in Mojave too. Maybe you could try it.
The folders in ~Library/Containers/ are the sandboxes for sandboxed applications. The files in them have nothing to do with defaults, and yes, you can’t change them.
I know next to nothing about preference files but I thought I would report what I tried.
I added the Terminal app to “Accessibility” and to “Full Disk Access” in “Security & Privacy.” The latter was suggested in the thread Nigel referenced.
I ran the following, which reported that the key could not be found:
I ran the following, which completed successfully:
I ran the following, which returned a 1:
I sent myself various emails using the macOS Mail app, and single-page attachments were shown inline–not as an icon as hoped. So, my uninformed opinion is that the value is set to disable inline attachment viewing but that setting is ignored by macOS.
BTW, multi-page attachments have always shown in Mail on my computer as an icon. Only single-page attachments are displayed inline.
I think, that the behaviour is governed by the saved state of the application. Therefore, you should try the described here, starting from step 7.
I must also say that before Mojave I did not use Mail.app and it was installed with the Mojave in the View as icon state, which is apparently the default state for users who have not used Mail.app before.
They correctly did that and I guess that Mojave didn’t returned to the old behavior.
We may assume that the app use a cached set of prefs filled on boot.
It would be interesting to quit and reboot just after applying the instruction supposed to write the wanted value.
Testing that on my machine wouldn’t be relevant as it’s not hosting Mojave.
As you wrote that you aren’t accustomed to plist files, it may be useful to write that you may look at them with BBEdit as well as with Xcode.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mercredi 14 aout 2019 17:19:00
To dissolve the confusion it’s indeed a question of enabling Full Disk Access in Mojave for the environment which is going to write into a property list file with /usr/bin/defaults write.
After enabling Full Disk Access for Script Debugger the line
do shell script "defaults write com.apple.mail DisableInlineAttachmentViewing -bool YES"
adds the key-value pair
<key>DisableInlineAttachmentViewing</key>
<true/>
in ~/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.mail.plist.
Yvan. I reran the command in the terminal, then quit and rebooted my computer, and then sent myself an email with an attachment. It still showed inline.
Thanks for the reference to BBEdit and Xcode. I need to learn a bit more about preference files.
Have you look at the plist to see what is stored?
As you issued the command:
[format]defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes[/format]
It’s supposed to display:
<key>DisableInlineAttachmentViewing</key>
<true/>
Most of the time I don’t try to change the contents of plists. I just look at their contents.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mercredi 14 aout 2019 18:13:30
Yvan. I installed BBEdit and looked at the plist file. It showed true just as in your post. I sent myself another email with an attachment and it still showed the attachment inline.