Fwd: Identifying a specific Mac model

2015-09-18 Thread Clark S. Cox III

> On 2015/09/16, at 1:38, Marek Hrušovský  > wrote:
> 
> Many thanks.
> What I have discovered is that they track model version as well:
> 
> Exported UTI
> com.apple.macbook-retina-silver
> com.apple.device-model-code
> MacBook8,1@ECOLOR=225,225,223
> 
> com.apple.macbook-retina-gold
> com.apple.device-model-code
> MacBook8,1@ECOLOR=235,215,191
> 
> com.apple.macbook-retina-space-gray
> com.apple.device-model-code
> MacBook8,1@ECOLOR=155,158,159
> MacBook8,1@ECOLOR=157,157,160
> 
> NSImage *image =[[NSWorkspace sharedWorkspace] iconForFileType:
> @"com.apple.macbook-retina-gold"];
> 
> What's shocking is that they left icons for the new hardware there before
> announcement:
> E.g this folder contains new watch colors/ iPhone6s/iPhone6s Plus and iPad4
> mini (not the TV 4rd)
> "
> /System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MobileDevices.bundle/Contents/Resources
> “

FYI: The 
“System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MobileDevices.bundle”
 bundle is installed by Xcode. Those icon's weren't there  on your machine 
before the announcement :)
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-16 Thread Uli Kusterer
I just tried it on the golden MacBook (in IB) and I got a golden icon.

> On 15 Sep 2015, at 15:59, John Daniel  wrote:
> 
> Thanks! That did the trick. It took a couple of tries to get it working. I 
> forgot that the namedImage method returns a scaled down image. it is a little 
> counter-intuitive, but you have to scale the image up and then it will pick 
> the bigger image in the icns file.
> 
> I still don’t know if it will display in gold on a new MacBook, but it seems 
> to work on two MacBookPros and an iMac.
> 
> John Daniel
> i...@etresoft.com
> 
> 
> 
>> On Sep 14, 2015, at 12:43 PM, Jean-Daniel Dupas  wrote:
>> 
>> If you just want to current machine icon, just use + [NSImage 
>> imageNamed:NSImageNameComputer]
>> 
>> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/witness.of.teachtext%40gmx.net
> 
> This email sent to witness.of.teacht...@gmx.net

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://stacksmith.org





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-16 Thread Marek Hrušovský
Many thanks.
What I have discovered is that they track model version as well:

Exported UTI
com.apple.macbook-retina-silver
com.apple.device-model-code
MacBook8,1@ECOLOR=225,225,223

com.apple.macbook-retina-gold
com.apple.device-model-code
MacBook8,1@ECOLOR=235,215,191

com.apple.macbook-retina-space-gray
com.apple.device-model-code
MacBook8,1@ECOLOR=155,158,159
MacBook8,1@ECOLOR=157,157,160

NSImage *image =[[NSWorkspace sharedWorkspace] iconForFileType:
@"com.apple.macbook-retina-gold"];

What's shocking is that they left icons for the new hardware there before
announcement:
E.g this folder contains new watch colors/ iPhone6s/iPhone6s Plus and iPad4
mini (not the TV 4rd)
"
/System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MobileDevices.bundle/Contents/Resources
"




On Wed, Sep 16, 2015 at 3:36 AM, John Daniel <
etresoft.apple.li...@icloud.com> wrote:

> Sure. The path to the new MacBook images is
> /System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MJTlrL7BTqUr.bundle
>
> However, it would be impossible for me to inspect this. Because I am using
> this system function, I could only see it go into this new bundle if I was
> running it on a new MacBook. It does seem to work, but my confidence is
> based more on faith than works.
>
> John Daniel
> i...@etresoft.com
>
>
>
> > On Sep 15, 2015, at 4:16 PM, Marek Hrušovský  wrote:
> >
> > Can you please tell us the path?
> > You can load it with mentioned method, then fire Activity, hit the
> inspect button on the process  (sample one line app that shows the icon in
> imageview) and one of those lines should be the icon.
> > Many thanks.
> >
> > On Tue, Sep 15, 2015 at 8:58 PM, John Daniel <
> etresoft.apple.li...@icloud.com >
> wrote:
> > There is a gold icon in the system. I am hopeful that this method will
> retrieve it, if running on a gold MacBook. If not, people are reporting
> that it at least displays a silver MacBook icon and that’s as good as I can
> do on my own.
> >
> > John Daniel
> >
> > > On Sep 15, 2015, at 2:54 PM, Marek Hrušovský  > wrote:
> > >
> > > I am just curious, is there a gold icon in the system or it's a guess
> that there should be one ?
> > >
> >
> >
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com  Cocoa-dev@lists.apple.com>)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com <
> http://lists.apple.com/>
> >
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com <
> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com>
> >
> > This email sent to xhrus...@gmail.com 
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com
>
> This email sent to xhrus...@gmail.com
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-15 Thread John Daniel
Sure. The path to the new MacBook images is 
/System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MJTlrL7BTqUr.bundle

However, it would be impossible for me to inspect this. Because I am using this 
system function, I could only see it go into this new bundle if I was running 
it on a new MacBook. It does seem to work, but my confidence is based more on 
faith than works.

John Daniel
i...@etresoft.com



> On Sep 15, 2015, at 4:16 PM, Marek Hrušovský  wrote:
> 
> Can you please tell us the path? 
> You can load it with mentioned method, then fire Activity, hit the inspect 
> button on the process  (sample one line app that shows the icon in imageview) 
> and one of those lines should be the icon.
> Many thanks. 
> 
> On Tue, Sep 15, 2015 at 8:58 PM, John Daniel  > wrote:
> There is a gold icon in the system. I am hopeful that this method will 
> retrieve it, if running on a gold MacBook. If not, people are reporting that 
> it at least displays a silver MacBook icon and that’s as good as I can do on 
> my own.
> 
> John Daniel
> 
> > On Sep 15, 2015, at 2:54 PM, Marek Hrušovský  > > wrote:
> >
> > I am just curious, is there a gold icon in the system or it's a guess that 
> > there should be one ?
> >
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
> )
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com 
> 
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com 
> 
> 
> This email sent to xhrus...@gmail.com 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-15 Thread John Daniel
There is a gold icon in the system. I am hopeful that this method will retrieve 
it, if running on a gold MacBook. If not, people are reporting that it at least 
displays a silver MacBook icon and that’s as good as I can do on my own.

John Daniel

> On Sep 15, 2015, at 2:54 PM, Marek Hrušovský  wrote:
> 
> I am just curious, is there a gold icon in the system or it's a guess that 
> there should be one ?
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-15 Thread Marek Hrušovský
I am just curious, is there a gold icon in the system or it's a guess that
there should be one ?

On Tue, Sep 15, 2015 at 3:59 PM, John Daniel <
etresoft.apple.li...@icloud.com> wrote:

> Thanks! That did the trick. It took a couple of tries to get it working. I
> forgot that the namedImage method returns a scaled down image. it is a
> little counter-intuitive, but you have to scale the image up and then it
> will pick the bigger image in the icns file.
>
> I still don’t know if it will display in gold on a new MacBook, but it
> seems to work on two MacBookPros and an iMac.
>
> John Daniel
> i...@etresoft.com
>
>
>
> > On Sep 14, 2015, at 12:43 PM, Jean-Daniel Dupas 
> wrote:
> >
> > If you just want to current machine icon, just use + [NSImage
> imageNamed:NSImageNameComputer]
> >
> >
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com
>
> This email sent to xhrus...@gmail.com
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-15 Thread Marek Hrušovský
Can you please tell us the path?
You can load it with mentioned method, then fire Activity, hit the inspect
button on the process  (sample one line app that shows the icon in
imageview) and one of those lines should be the icon.
Many thanks.

On Tue, Sep 15, 2015 at 8:58 PM, John Daniel <
etresoft.apple.li...@icloud.com> wrote:

> There is a gold icon in the system. I am hopeful that this method will
> retrieve it, if running on a gold MacBook. If not, people are reporting
> that it at least displays a silver MacBook icon and that’s as good as I can
> do on my own.
>
> John Daniel
>
> > On Sep 15, 2015, at 2:54 PM, Marek Hrušovský  wrote:
> >
> > I am just curious, is there a gold icon in the system or it's a guess
> that there should be one ?
> >
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com
>
> This email sent to xhrus...@gmail.com
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-15 Thread John Daniel
Thanks! That did the trick. It took a couple of tries to get it working. I 
forgot that the namedImage method returns a scaled down image. it is a little 
counter-intuitive, but you have to scale the image up and then it will pick the 
bigger image in the icns file.

I still don’t know if it will display in gold on a new MacBook, but it seems to 
work on two MacBookPros and an iMac.

John Daniel
i...@etresoft.com



> On Sep 14, 2015, at 12:43 PM, Jean-Daniel Dupas  wrote:
> 
> If you just want to current machine icon, just use + [NSImage 
> imageNamed:NSImageNameComputer]
> 
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread Marek Hrušovský
Those new images are simply not where they should be: "
/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/"

I think your only way is to grab serial code and scrape the image that is
displayed here:
https://selfsolve.apple.com/agreementWarrantyDynamic.do


e.g. It shows color of my iPhone. I can't verify the new macbooks.
In any case Yosemite/Mavericks is not getting any update so don't expect
you will see those icons on older systems.

On Mon, Sep 14, 2015 at 1:11 PM, Jean-Daniel Dupas 
wrote:

>
> > Le 14 sept. 2015 à 12:16, sqwarqDev  a écrit :
> >
> >
> > On 14 Sep 2015, at 01:09, John Daniel 
> wrote:
> >
> >>
> >> MacBook8,1 covers all colours of the new MacBook.
> >> I am trying to differentiate the silver, from the space grey, from the
> gold.
> >
> > Since the machines are physically identical save the paint job, I don’t
> think anything like sysctl or any other hardware identifier is going to
> help you. The only difference I’d imagine between a silver and gold MB
> would be the catalogue/product number. For example, Mactracker has the
> following order numbers for the 2015 MB:
> >
> >> MF855LL/A (1.1 GHz with 256 GB storage, Silver) MK4M2LL/A (1.1 GHz with
> 256 GB storage, Gold) MJY32LL/A (1.1 GHz with 256 GB storage, Space Gray)
> MF865LL/A (1.2 GHz with 512 GB storage, Silver) MK4N2LL/A (1.2 GHz with 512
> GB storage, Gold) MJY42LL/A (1.2 GHz with 512 GB storage, Space Gray)
> >
> > The chances of this being coded into the machine itself I’d imagine are
> zero. If that’s right, then the best you can do is ask your user to enter
> that information in order to display the correct icon. In lieu of that,
> your only option is to display a generic icon for the model identifier that
> you find in the usual way(s).
> >
>
>
> Apple used to display the right color for iPod icons, why wouldn’t they do
> it too for new MacBook network icon. Especially as the three variants are
> present in the System icons. I’m pretty sure the color is coded somewhere
> in the machine.
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com
>
> This email sent to xhrus...@gmail.com
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread Pascal J. Bourguignon



On 14/09/15 13:11, Jean-Daniel Dupas wrote:
Apple used to display the right color for iPod icons, why wouldn’t 
they do it too for new MacBook network icon. Especially as the three 
variants are present in the System icons. I’m pretty sure the color is 
coded somewhere in the machine.


Not necessarily. I mean, not hard coded; for example, they could easily 
use the webcam during the flipping open of the laptop to identify the 
anodization color and keep it in RAM all the time.  You would have a 
harder time having your own code running at the right moment, but you 
could always ask the user to flip the screen down until you can see the 
trackpad.


You can test my theory, by inserting a picture of another anodization 
color over the trackpad before opening the MacBook, and see if the icon 
color changes.


--
__Pascal J. Bourguignon__
http://www.informatimago.com/

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread Jean-Daniel Dupas

> Le 14 sept. 2015 à 12:16, sqwarqDev  a écrit :
> 
> 
> On 14 Sep 2015, at 01:09, John Daniel  wrote:
> 
>> 
>> MacBook8,1 covers all colours of the new MacBook.
>> I am trying to differentiate the silver, from the space grey, from the gold.
> 
> Since the machines are physically identical save the paint job, I don’t think 
> anything like sysctl or any other hardware identifier is going to help you. 
> The only difference I’d imagine between a silver and gold MB would be the 
> catalogue/product number. For example, Mactracker has the following order 
> numbers for the 2015 MB:
> 
>> MF855LL/A (1.1 GHz with 256 GB storage, Silver) MK4M2LL/A (1.1 GHz with 256 
>> GB storage, Gold) MJY32LL/A (1.1 GHz with 256 GB storage, Space Gray) 
>> MF865LL/A (1.2 GHz with 512 GB storage, Silver) MK4N2LL/A (1.2 GHz with 512 
>> GB storage, Gold) MJY42LL/A (1.2 GHz with 512 GB storage, Space Gray)
> 
> The chances of this being coded into the machine itself I’d imagine are zero. 
> If that’s right, then the best you can do is ask your user to enter that 
> information in order to display the correct icon. In lieu of that, your only 
> option is to display a generic icon for the model identifier that you find in 
> the usual way(s).
> 


Apple used to display the right color for iPod icons, why wouldn’t they do it 
too for new MacBook network icon. Especially as the three variants are present 
in the System icons. I’m pretty sure the color is coded somewhere in the 
machine.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread sqwarqDev

On 14 Sep 2015, at 01:09, John Daniel  wrote:

> 
> MacBook8,1 covers all colours of the new MacBook.
> I am trying to differentiate the silver, from the space grey, from the gold.

Since the machines are physically identical save the paint job, I don’t think 
anything like sysctl or any other hardware identifier is going to help you. The 
only difference I’d imagine between a silver and gold MB would be the 
catalogue/product number. For example, Mactracker has the following order 
numbers for the 2015 MB:

> MF855LL/A (1.1 GHz with 256 GB storage, Silver) MK4M2LL/A (1.1 GHz with 256 
> GB storage, Gold) MJY32LL/A (1.1 GHz with 256 GB storage, Space Gray) 
> MF865LL/A (1.2 GHz with 512 GB storage, Silver) MK4N2LL/A (1.2 GHz with 512 
> GB storage, Gold) MJY42LL/A (1.2 GHz with 512 GB storage, Space Gray)

The chances of this being coded into the machine itself I’d imagine are zero. 
If that’s right, then the best you can do is ask your user to enter that 
information in order to display the correct icon. In lieu of that, your only 
option is to display a generic icon for the model identifier that you find in 
the usual way(s).


Best


Phil
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread John Daniel
Thanks for the responses. Unfortunately, Apple is way ahead of all of us.

The “Model Identifier” (MacBook8,1 et al.) is not sufficient to identify a 
particular model. It only identifies general families of models. All you have 
to do is go to My OWC (http://eshop.macsales.com/MyOWC/ 
), pick MacBook Pro, and look at the options. 

The system images are where they should be. I don’t understand Apple’s 
reasoning, but that is where Apple wants them. 

I don’t know if Apple even tracks the colour of the retina MacBooks. I don’t 
have one myself. I haven’t been able to find a serial number online. The serial 
number generator scripts posted online don’t generate valid serial numbers for 
this model. 

Scraping the Apple self-service warranty page might work, but I don’t have any 
MacBook serial numbers for testing. I really don’t want to parse HTML. Even so, 
people seem to treat serial numbers as personal information and might freak out 
if I start sending them over the internet. If I had a few serial numbers for 
testing, I would know more - or at least something.

I do extract the last 4 characters and send them to Apple’s support web 
services to get the “marketing name” like "MacBook (Retina, 12-inch, Early 
2015)”. But those names don’t seem to include colour. I know of a few different 
queries for Apple’s services for technical specifications, possible memory 
upgrades, OS name, and this marketing name. This is a true web service that 
returns parseable XML. I don’t know if there is any query that will give me the 
machine icon.

John Daniel

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread Maxthon Chan
It is encoded but only in the serial number, which you have no access to, and 
have almost no way to map back.

> On Sep 14, 2015, at 18:16, sqwarqDev  wrote:
> 
> 
> On 14 Sep 2015, at 01:09, John Daniel  wrote:
> 
>> 
>> MacBook8,1 covers all colours of the new MacBook.
>> I am trying to differentiate the silver, from the space grey, from the gold.
> 
> Since the machines are physically identical save the paint job, I don’t think 
> anything like sysctl or any other hardware identifier is going to help you. 
> The only difference I’d imagine between a silver and gold MB would be the 
> catalogue/product number. For example, Mactracker has the following order 
> numbers for the 2015 MB:
> 
>> MF855LL/A (1.1 GHz with 256 GB storage, Silver) MK4M2LL/A (1.1 GHz with 256 
>> GB storage, Gold) MJY32LL/A (1.1 GHz with 256 GB storage, Space Gray) 
>> MF865LL/A (1.2 GHz with 512 GB storage, Silver) MK4N2LL/A (1.2 GHz with 512 
>> GB storage, Gold) MJY42LL/A (1.2 GHz with 512 GB storage, Space Gray)
> 
> The chances of this being coded into the machine itself I’d imagine are zero. 
> If that’s right, then the best you can do is ask your user to enter that 
> information in order to display the correct icon. In lieu of that, your only 
> option is to display a generic icon for the model identifier that you find in 
> the usual way(s).
> 
> 
> Best
> 
> 
> Phil
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/max%40maxchan.info
> 
> This email sent to m...@maxchan.info



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread Jean-Daniel Dupas

> Le 14 sept. 2015 à 15:53, John Daniel  a 
> écrit :
> 
> Thanks for the responses. Unfortunately, Apple is way ahead of all of us.
> 
> The “Model Identifier” (MacBook8,1 et al.) is not sufficient to identify a 
> particular model. It only identifies general families of models. All you have 
> to do is go to My OWC (http://eshop.macsales.com/MyOWC/ 
> ), pick MacBook Pro, and look at the 
> options. 
> 
> The system images are where they should be. I don’t understand Apple’s 
> reasoning, but that is where Apple wants them. 
> 
> I don’t know if Apple even tracks the colour of the retina MacBooks. I don’t 
> have one myself. I haven’t been able to find a serial number online. The 
> serial number generator scripts posted online don’t generate valid serial 
> numbers for this model. 
> 
> Scraping the Apple self-service warranty page might work, but I don’t have 
> any MacBook serial numbers for testing. I really don’t want to parse HTML. 
> Even so, people seem to treat serial numbers as personal information and 
> might freak out if I start sending them over the internet. If I had a few 
> serial numbers for testing, I would know more - or at least something.
> 
> I do extract the last 4 characters and send them to Apple’s support web 
> services to get the “marketing name” like "MacBook (Retina, 12-inch, Early 
> 2015)”. But those names don’t seem to include colour. I know of a few 
> different queries for Apple’s services for technical specifications, possible 
> memory upgrades, OS name, and this marketing name. This is a true web service 
> that returns parseable XML. I don’t know if there is any query that will give 
> me the machine icon.
> 

If you just want to current machine icon, just use + [NSImage 
imageNamed:NSImageNameComputer]



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread Marek Hrušovský
NSPipe *outputPipe = [NSPipe pipe];NSTask *task = [[NSTask alloc]
init];[task setLaunchPath:@"/usr/sbin/system_profiler"];[task
setArguments:@[@"SPHardwareDataType"]];[task
setStandardOutput:outputPipe];[task launch];[task
waitUntilExit];NSData *outputData = [[outputPipe fileHandleForReading]
readDataToEndOfFile];NSString *hardware = [[NSString alloc]
initWithData:outputData encoding:NSUTF8StringEncoding];


Mareks-MacBook-Pro:~ xhruso00$ /usr/sbin/system_profiler SPHardwareDataType

Hardware:


Hardware Overview:


  Model Name: MacBook Pro

  Model Identifier: MacBookPro6,2

  Processor Name: Intel Core i5

  Processor Speed: 2,4 GHz

  Number of Processors: 1

  Total Number of Cores: 2

  L2 Cache (per Core): 256 KB

  L3 Cache: 3 MB

  Memory: 8 GB

  Processor Interconnect Speed: 4,8 GT/s

  Boot ROM Version: MBP61.0057.B10

  SMC Version (system): 1.58f17

  Serial Number (system): hidden

  Hardware UUID: hidden

  Sudden Motion Sensor:

  State: Enabled

On Mon, Sep 14, 2015 at 10:17 AM, Robert Tillyard 
wrote:

> Hello, John,
>
> I use this to get the model number:
>
>
> + (NSString *)computerModel
> {
> char modelBuffer[256];
> size_t sz = sizeof(modelBuffer);
>
> if (0 == sysctlbyname("hw.model", modelBuffer, , NULL, 0)) {
> modelBuffer[sizeof(modelBuffer) - 1] = 0;
> return [NSString stringWithCString:modelBuffer
> encoding:[NSString defaultCStringEncoding]];
> }
>
> return nil;
> }
>
> Regards, Rob.
>
>
> > On 14 Sep 2015, at 01:09, John Daniel 
> wrote:
> >
> > Hello,
> > Does anyone know of an API or utility that will identify specific Mac
> models? The “Model Identifier” like “MacBook8,1” is not sufficient to
> uniquely describe a model. MacBook8,1 covers all colours of the new
> MacBook. I am trying to differentiate the silver, from the space grey, from
> the gold.
> >
> > My app has an animation where it cycles through various Macs like a slot
> machine, finally landing on the user’s specific machine. I used to just
> look at the “Model Identifier”. I could pretty easily identify the matching
> machine image from
> /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources.
> >
> > However, the images for the new retina MacBook are in a different
> location. I found where they live in an apparently randomly-named
> framework, but I still can’t connect a specific image with the user’s
> specific machine. There is a private API for the UIDevice class in iOS that
> provides similar information. Is there anything like this for the Mac?
> >
> > Thanks,
> >
> > John Daniel
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com
>
> This email sent to xhrus...@gmail.com
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread Robert Tillyard
Hello, John,

I use this to get the model number:


+ (NSString *)computerModel
{
char modelBuffer[256];
size_t sz = sizeof(modelBuffer);

if (0 == sysctlbyname("hw.model", modelBuffer, , NULL, 0)) {
modelBuffer[sizeof(modelBuffer) - 1] = 0;
return [NSString stringWithCString:modelBuffer 
encoding:[NSString defaultCStringEncoding]];
}

return nil;
}

Regards, Rob.


> On 14 Sep 2015, at 01:09, John Daniel  wrote:
> 
> Hello,
> Does anyone know of an API or utility that will identify specific Mac models? 
> The “Model Identifier” like “MacBook8,1” is not sufficient to uniquely 
> describe a model. MacBook8,1 covers all colours of the new  MacBook. I am 
> trying to differentiate the silver, from the space grey, from the gold.
> 
> My app has an animation where it cycles through various Macs like a slot 
> machine, finally landing on the user’s specific machine. I used to just look 
> at the “Model Identifier”. I could pretty easily identify the matching 
> machine image from 
> /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources. 
> 
> However, the images for the new retina MacBook are in a different location. I 
> found where they live in an apparently randomly-named framework, but I still 
> can’t connect a specific image with the user’s specific machine. There is a 
> private API for the UIDevice class in iOS that provides similar information. 
> Is there anything like this for the Mac?
> 
> Thanks,
> 
> John Daniel
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread Marek Hrušovský
To get color/icon Manually map model identifier to icon name and then use
e.g

[[NSWorkspace sharedWorkspace] iconForFileType:@"com.apple.macbookair"];

http://stackoverflow.com/questions/32370037/is-there-a-way-of-getting-a-macs-icon-given-its-model-number/32373977#32373977

On Mon, Sep 14, 2015 at 11:17 AM, Marek Hrušovský 
wrote:

> NSPipe *outputPipe = [NSPipe pipe];NSTask *task = [[NSTask alloc] init];[task 
> setLaunchPath:@"/usr/sbin/system_profiler"];[task 
> setArguments:@[@"SPHardwareDataType"]];[task 
> setStandardOutput:outputPipe];[task launch];[task waitUntilExit];NSData 
> *outputData = [[outputPipe fileHandleForReading] 
> readDataToEndOfFile];NSString *hardware = [[NSString alloc] 
> initWithData:outputData encoding:NSUTF8StringEncoding];
>
>
> Mareks-MacBook-Pro:~ xhruso00$ /usr/sbin/system_profiler SPHardwareDataType
>
> Hardware:
>
>
> Hardware Overview:
>
>
>   Model Name: MacBook Pro
>
>   Model Identifier: MacBookPro6,2
>
>   Processor Name: Intel Core i5
>
>   Processor Speed: 2,4 GHz
>
>   Number of Processors: 1
>
>   Total Number of Cores: 2
>
>   L2 Cache (per Core): 256 KB
>
>   L3 Cache: 3 MB
>
>   Memory: 8 GB
>
>   Processor Interconnect Speed: 4,8 GT/s
>
>   Boot ROM Version: MBP61.0057.B10
>
>   SMC Version (system): 1.58f17
>
>   Serial Number (system): hidden
>
>   Hardware UUID: hidden
>
>   Sudden Motion Sensor:
>
>   State: Enabled
>
> On Mon, Sep 14, 2015 at 10:17 AM, Robert Tillyard 
> wrote:
>
>> Hello, John,
>>
>> I use this to get the model number:
>>
>>
>> + (NSString *)computerModel
>> {
>> char modelBuffer[256];
>> size_t sz = sizeof(modelBuffer);
>>
>> if (0 == sysctlbyname("hw.model", modelBuffer, , NULL, 0)) {
>> modelBuffer[sizeof(modelBuffer) - 1] = 0;
>> return [NSString stringWithCString:modelBuffer
>> encoding:[NSString defaultCStringEncoding]];
>> }
>>
>> return nil;
>> }
>>
>> Regards, Rob.
>>
>>
>> > On 14 Sep 2015, at 01:09, John Daniel 
>> wrote:
>> >
>> > Hello,
>> > Does anyone know of an API or utility that will identify specific Mac
>> models? The “Model Identifier” like “MacBook8,1” is not sufficient to
>> uniquely describe a model. MacBook8,1 covers all colours of the new
>> MacBook. I am trying to differentiate the silver, from the space grey, from
>> the gold.
>> >
>> > My app has an animation where it cycles through various Macs like a
>> slot machine, finally landing on the user’s specific machine. I used to
>> just look at the “Model Identifier”. I could pretty easily identify the
>> matching machine image from
>> /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources.
>> >
>> > However, the images for the new retina MacBook are in a different
>> location. I found where they live in an apparently randomly-named
>> framework, but I still can’t connect a specific image with the user’s
>> specific machine. There is a private API for the UIDevice class in iOS that
>> provides similar information. Is there anything like this for the Mac?
>> >
>> > Thanks,
>> >
>> > John Daniel
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com
>>
>> This email sent to xhrus...@gmail.com
>>
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-14 Thread sqwarqDev
Sorry for top posting, but Robert and Marek seem to have missed the point of 
the OP’s request, to wit:

> The “Model Identifier” like “MacBook8,1” is not sufficient to uniquely 
> describe a model

Unsurprisingly John, I don’t know the answer either I’m afraid. ;-).


Best


Phil



> On 14 Sep 2015, at 16:17, Marek Hrušovský  wrote:
> 
> NSPipe *outputPipe = [NSPipe pipe];NSTask *task = [[NSTask alloc]
> init];[task setLaunchPath:@"/usr/sbin/system_profiler"];[task
> setArguments:@[@"SPHardwareDataType"]];[task
> setStandardOutput:outputPipe];[task launch];[task
> waitUntilExit];NSData *outputData = [[outputPipe fileHandleForReading]
> readDataToEndOfFile];NSString *hardware = [[NSString alloc]
> initWithData:outputData encoding:NSUTF8StringEncoding];
> 
> 
> Mareks-MacBook-Pro:~ xhruso00$ /usr/sbin/system_profiler SPHardwareDataType
> 
> Hardware:
> 
> 
>Hardware Overview:
> 
> 
>  Model Name: MacBook Pro
> 
>  Model Identifier: MacBookPro6,2
> 
>  Processor Name: Intel Core i5
> 
>  Processor Speed: 2,4 GHz
> 
>  Number of Processors: 1
> 
>  Total Number of Cores: 2
> 
>  L2 Cache (per Core): 256 KB
> 
>  L3 Cache: 3 MB
> 
>  Memory: 8 GB
> 
>  Processor Interconnect Speed: 4,8 GT/s
> 
>  Boot ROM Version: MBP61.0057.B10
> 
>  SMC Version (system): 1.58f17
> 
>  Serial Number (system): hidden
> 
>  Hardware UUID: hidden
> 
>  Sudden Motion Sensor:
> 
>  State: Enabled
> 
> On Mon, Sep 14, 2015 at 10:17 AM, Robert Tillyard 
> wrote:
> 
>> Hello, John,
>> 
>> I use this to get the model number:
>> 
>> 
>> + (NSString *)computerModel
>> {
>>char modelBuffer[256];
>>size_t sz = sizeof(modelBuffer);
>> 
>>if (0 == sysctlbyname("hw.model", modelBuffer, , NULL, 0)) {
>>modelBuffer[sizeof(modelBuffer) - 1] = 0;
>>return [NSString stringWithCString:modelBuffer
>> encoding:[NSString defaultCStringEncoding]];
>>}
>> 
>>return nil;
>> }
>> 
>> Regards, Rob.
>> 
>> 
>>> On 14 Sep 2015, at 01:09, John Daniel 
>> wrote:
>>> 
>>> Hello,
>>> Does anyone know of an API or utility that will identify specific Mac
>> models? The “Model Identifier” like “MacBook8,1” is not sufficient to
>> uniquely describe a model. MacBook8,1 covers all colours of the new
>> MacBook. I am trying to differentiate the silver, from the space grey, from
>> the gold.
>>> 
>>> My app has an animation where it cycles through various Macs like a slot
>> machine, finally landing on the user’s specific machine. I used to just
>> look at the “Model Identifier”. I could pretty easily identify the matching
>> machine image from
>> /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources.
>>> 
>>> However, the images for the new retina MacBook are in a different
>> location. I found where they live in an apparently randomly-named
>> framework, but I still can’t connect a specific image with the user’s
>> specific machine. There is a private API for the UIDevice class in iOS that
>> provides similar information. Is there anything like this for the Mac?
>>> 
>>> Thanks,
>>> 
>>> John Daniel
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/xhruso00%40gmail.com
>> 
>> This email sent to xhrus...@gmail.com
>> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/sqwarqdev%40icloud.com
> 
> This email sent to sqwarq...@icloud.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Identifying a specific Mac model

2015-09-13 Thread John Daniel
Hello,
Does anyone know of an API or utility that will identify specific Mac models? 
The “Model Identifier” like “MacBook8,1” is not sufficient to uniquely describe 
a model. MacBook8,1 covers all colours of the new  MacBook. I am trying to 
differentiate the silver, from the space grey, from the gold.

My app has an animation where it cycles through various Macs like a slot 
machine, finally landing on the user’s specific machine. I used to just look at 
the “Model Identifier”. I could pretty easily identify the matching machine 
image from /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources. 

However, the images for the new retina MacBook are in a different location. I 
found where they live in an apparently randomly-named framework, but I still 
can’t connect a specific image with the user’s specific machine. There is a 
private API for the UIDevice class in iOS that provides similar information. Is 
there anything like this for the Mac?

Thanks,

John Daniel


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Identifying a specific Mac model

2015-09-13 Thread Maxthon Chan
I think this can only be done by searching Apple databases, or try to 
understand the machine’s serial number. I don’t think Apple now allows the 
developer to do this at all.

> On Sep 14, 2015, at 08:09, John Daniel  
> wrote:
> 
> Hello,
> Does anyone know of an API or utility that will identify specific Mac models? 
> The “Model Identifier” like “MacBook8,1” is not sufficient to uniquely 
> describe a model. MacBook8,1 covers all colours of the new  MacBook. I am 
> trying to differentiate the silver, from the space grey, from the gold.
> 
> My app has an animation where it cycles through various Macs like a slot 
> machine, finally landing on the user’s specific machine. I used to just look 
> at the “Model Identifier”. I could pretty easily identify the matching 
> machine image from 
> /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources. 
> 
> However, the images for the new retina MacBook are in a different location. I 
> found where they live in an apparently randomly-named framework, but I still 
> can’t connect a specific image with the user’s specific machine. There is a 
> private API for the UIDevice class in iOS that provides similar information. 
> Is there anything like this for the Mac?
> 
> Thanks,
> 
> John Daniel
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/max%40maxchan.info
> 
> This email sent to m...@maxchan.info



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com