• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Need to remove Dock icon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need to remove Dock icon


  • Subject: Re: Need to remove Dock icon
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 14 Sep 2016 15:06:37 +1000

OK, point taken. I’ve been suspecting that my mind is losing memory for some time now, and you’ve just confirmed it.

I’m finding that I’m having trouble thinking of correct search terms, and not understanding what I’m reading.

My apolgies for sounding off.

ATM I’m trying  to get the properties of the Docks UI element “Mail Manager” of list 1. Perhaps I can reset property 17, which is ‘false’, and hopefully might indicate the state of the Dock persitance, which is what I’ve really been trying to set. I found a way 12 months ago to create a ‘Stay in Dock’ icon for my App, but user Sierra, a second icon is created. So, I though I’d remove it, and leave my persitant icon alone. Might have to change my approach.

If I ask stupid questions in future, please bear with the state of my memory, cause I‘m constantly having to re-learn things that once came easily.

Brian

On 14 Sep. 2016, at 2:40 pm, Shane Stanley <email@hidden> wrote:

On 14 Sep 2016, at 1:47 PM, Brian Christmas <email@hidden> wrote:

I have no idea how to use NSUserDefaults, and copied something I found on the net, which has a dearth of information on the term.

You didn't search very hard -- did you search for "AppleScript NSUserDefaults"? Or perhaps search the two ASObjC books on your hard drive? Or even search for past posts to this list?

Here's a post to this list from February this year:

Code is (for posterity)…

on installDockIcon()
try

set theInfo to (current application's NSUserDefaults's alloc()'s init()'s persistentDomainForName:"com.apple.dock") as record

So I reckon the person who posted that might know at least something about NSUserDefaults. He goes by the name of Brian Christmas. Heck, I can see a post where the same guy used NSUserDefaults back in 2012. Maybe you should speak to him.

OK, I take your point I should not interfere, but if there’s absolutely no way I can remove a dock icon, just say so in plain terms

I don't know whether there is or not -- I haven't tried. I'm just saying don't expect there necessarily is, and stop trying to do it via the property list file, because that's guaranteed to be unreliable at best. If there is a way that works reliably, it will be via defaults and do shell script, or by using NSUserDefaults.

To do it via NSUserDefaults you can use something like this:

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions

set defaults to current application's NSUserDefaults's standardUserDefaults()
-- get existing values
set theValues to (defaults's persistentDomainForName:"com.apple.dock") as record
-- modify theValues to suit in here, then set to the new values...
defaults's setPersistentDomain:theValues forName:"com.apple.dock"


-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>

And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Need to remove Dock icon (From: Brian Christmas <email@hidden>)
 >Re: Need to remove Dock icon (From: Shane Stanley <email@hidden>)
 >Re: Need to remove Dock icon (From: Brian Christmas <email@hidden>)
 >Re: Need to remove Dock icon (From: Shane Stanley <email@hidden>)
 >Re: Need to remove Dock icon (From: Brian Christmas <email@hidden>)
 >Re: Need to remove Dock icon (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: problem with POSIX path of Š
  • Next by Date: Re: How to activate script embedded in Application Folder in Applications?
  • Previous by thread: Re: Need to remove Dock icon
  • Next by thread: Re: problem with POSIX path of …
  • Index(es):
    • Date
    • Thread