Tuesday, August 20, 2019

#1 2019-08-13 09:51:50 am

LouK
Member
From:: Santa Fe NM
Registered: 2015-03-20
Posts: 37

Mail view as icon default

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:

"defaults write com.apple.mail DisableInlineAttachmentViewing -bool YES"

Any help is appreciated.


Thnaks


Filed under: mail, terminal, view as icon

Offline

 

#2 2019-08-13 12:16:01 pm

KniazidisR
Member
Registered: 2019-03-03
Posts: 425

Re: Mail view as icon default

I don't know if this will work, but try:

Applescript:


set MailPlistPath to POSIX path of (path to home folder) & "Library/Containers/com.apple.mail/Container.plist"
do shell script "defaults write " & MailPlistPath & " DisableInlineAttachmentViewing -bool YES"

UPDATE: Apple seems to have blocked the read and write permissions to this plist.

Last edited by KniazidisR (2019-08-13 12:39:32 pm)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

#3 2019-08-13 01:13:13 pm

LouK
Member
From:: Santa Fe NM
Registered: 2015-03-20
Posts: 37

Re: Mail view as icon default

Tried the shell script. Got:

"2019-08-13 13:08:27.313 defaults[32248:6104545] Could not write domain /Users/lk/Library/Containers/com.apple.mail/Container.plist"

Doesn't seem to want to write and I'm tired of changing image to icon all the time.


Thanks for your help.

Offline

 

#4 2019-08-13 01:49:32 pm

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 4940

Re: Mail view as icon default

Hi.

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.


NG

Offline

 

#5 2019-08-13 03:27:21 pm

LouK
Member
From:: Santa Fe NM
Registered: 2015-03-20
Posts: 37

Re: Mail view as icon default

Can you refer me to info as to how to write to this domain?

And can't Apple add one more radio button under viewing preferences for this? It's annoying.

If you tell me that displaying attachments as images improves security I think I will scream.


Thanks for the reply.

Offline

 

#6 2019-08-13 04:10:17 pm

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 4940

Re: Mail view as icon default

LouK wrote:

Can you refer me to info as to how to write to this domain?


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.


NG

Offline

 

#7 2019-08-13 11:56:32 pm

KniazidisR
Member
Registered: 2019-03-03
Posts: 425

Re: Mail view as icon default

With this playlist file I mentioned above, it is generally not clear what is going on. Get-info shows that I have the permissions to read and write to it. But as soon as I try to open it in Xcode, I get a message that I do not even have the permissions to read it. And in Mail, I hoped to find the contextual menu "View as icon" by right-clicking on PDF attacement, as explained 100 times on 100 sites. But ... it just isn't there.

The only logical suggestion I meet on sites is to temporarily disable SIP, change the setting and enable SIP back. This approach has helped me out several times with surprises from Apple.

And were is that plist? On my Mac:    ~Library/Containers/com.apple.mail/Container.plist

I tried to delete this file and it was deleted without difficulty. When Mail starts, it resurrects what it was. It is unclear ... I do not have read/write permissions, but they allow me to delete it, but not to read it.

It seems that Apple has embedded something in this file that tracks my mail and they would not want the user to know about it.

I can't restart my computer now to examine what data contains this plist. My computer is busy, is one job, which will finished tonight.

And why the container Containers/com.apple.mail/Container.plist and not just Preferences/com.apple.mail.plist if there is only 1 plist file inside? It's unclear ... On Windows, I'm tired of viruses, on MAC - from Apple surprises.

Last edited by KniazidisR (2019-08-14 12:33:05 am)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

#8 2019-08-14 01:05:55 am

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5825

Re: Mail view as icon default

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.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Online

 

#9 2019-08-14 01:19:45 am

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11578
Website

Re: Mail view as icon default

The path is wrong anyway. The path of the preference file of Mail in the sandbox is

~/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.mail.plist

And the file extension must be omitted if the path is used as a parameter of /usr/bin/defaults

Last edited by StefanK (2019-08-14 09:49:47 am)


regards

Stefan

Offline

 

#10 2019-08-14 03:18:44 am

KniazidisR
Member
Registered: 2019-03-03
Posts: 425

Re: Mail view as icon default

StefanK wrote:

~/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.mail.plist



Now I see the key DisableInlineAttachmentViewing in this plist, and its value is YES. I don't know how this happen. It seems, this happen after running the OP's code. I copied this plist to the desktop to see its contents in xCode. But it seems this doesn't affect the behaviour

Yes, I tested now with NO - this key's value changes with OP's code. But without affecting the behaviour.

Last edited by KniazidisR (2019-08-14 06:37:45 am)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

#11 2019-08-14 08:07:52 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 136

Re: Mail view as icon default

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:

defaults read com.apple.mail DisableInlineAttachmentViewing


I ran the following, which completed successfully:

defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes


I ran the following, which returned a 1:

defaults read com.apple.mail DisableInlineAttachmentViewing


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.

Last edited by peavine (2019-08-14 09:02:48 am)


2018 Mac mini - macOS Mojave

Online

 

#12 2019-08-14 08:11:46 am

KniazidisR
Member
Registered: 2019-03-03
Posts: 425

Re: Mail view as icon default

Hi, LouK.

I tried disabling SIP, but that did not help. I must tell you that my Mail shows icons in View as Icon mode, that is, I tried to do the opposite of what you did. And I did not succeed through disabling SIP.
Note: I tried with mully-page pdf (in one message), then with 1 photo (in other message)

From this, I conclude that the behavior 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.

Last edited by KniazidisR (2019-08-14 10:40:16 am)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

#13 2019-08-14 09:28:59 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3538

Re: Mail view as icon default

peavine wrote:


I ran the following, which completed successfully:

defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes


I ran the following, which returned a 1:

defaults read com.apple.mail DisableInlineAttachmentViewing


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.




Maybe it wouldn't be relevant as I'm not running Mojave.
I checked that your shell commands correctly apply to the 'modern' file which is :

~/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.mail.plist

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

Last edited by Yvan Koenig (2019-08-14 09:37:01 am)

Offline

 

#14 2019-08-14 09:45:29 am

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11578
Website

Re: Mail view as icon default

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

Applescript:

do shell script "defaults write com.apple.mail DisableInlineAttachmentViewing -bool YES"

adds the key-value pair

Applescript:



<key>DisableInlineAttachmentViewing</key>
<true/>

in ~/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.mail.plist.

Last edited by StefanK (2019-08-14 09:46:11 am)


regards

Stefan

Offline

 

#15 2019-08-14 10:03:28 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 136

Re: Mail view as icon default

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.

Last edited by peavine (2019-08-14 10:07:29 am)


2018 Mac mini - macOS Mojave

Online

 

#16 2019-08-14 10:13:50 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3538

Re: Mail view as icon default

peavine wrote:

Yvan. I reran the command in the terminal, then 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:

defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes

It's supposed to display:

Applescript:

<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

Last edited by Yvan Koenig (2019-08-14 10:17:18 am)

Offline

 

#17 2019-08-14 10:18:12 am

KniazidisR
Member
Registered: 2019-03-03
Posts: 425

Re: Mail view as icon default

It shows:

Applescript:

<key>DisableInlineAttachmentViewing</key>
<YES/>

--or

<key>DisableInlineAttachmentViewing</key>
<NO/>

Download from HERE. And, I checked - opening the "Mail" doesn't rewrite the setting for this key. It seems, the "Mail" ignores this key.

Last edited by KniazidisR (2019-08-14 10:42:41 am)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

#18 2019-08-14 02:51:30 pm

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 136

Re: Mail view as icon default

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.


2018 Mac mini - macOS Mojave

Online

 

#19 2019-08-14 03:45:54 pm

KniazidisR
Member
Registered: 2019-03-03
Posts: 425

Re: Mail view as icon default

To clarify the situation, already so confusing. In xCode, all values are shown as YES/NO, and in BBedit, they are shown as true/false.

But that is not the point. So far, my post has been completely ignored here regarding the saved state of the application. Until nobody checks this, the situation will not be clarified.

And I can't check this, as in my "Mail" all kind of attachments are shown in a View as Icon state.

2Wf3z.png

Last edited by KniazidisR (2019-08-14 04:07:24 pm)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)