Unique Macintosh Identification (Follow-up)

MisterX mister.x at win.be
Fri Feb 22 13:10:01 EST 2002


for NT(x)'s

get shell("ipconfig /all | findstr /i mac")

Gosh, I hate NT sometimes... But there's the Mac I hate!

Problem with that setup on the mac is that it may not run if the user played
with his apple menu and who in their right mind wouldn't

http://perso.wanadoo.fr/frederic.rinaldi -> Stack collection -> click on
network or click...
http://perso.wanadoo.fr/frederic.rinaldi/fcollection_list.htm#Network

click on the disk and you got your XFCN.

Much faster, no delays, no dependencies on system changes or version, the
flaky AS or nothing.
(Requires installation, batteries not incl.)

HyperCard RULES! at least when it's supported!
Hurrah for Scott for making the ways of the past the ways of the future

MisterX
your friendly scripting Monk!
  -----Original Message-----
  From: metacard-admin at lists.runrev.com
[mailto:metacard-admin at lists.runrev.com]On Behalf Of Ken Ray
  Sent: Friday, February 22, 2002 18:04
  To: metacard at lists.runrev.com
  Subject: Unique Macintosh Identification (Follow-up)


  Hey, everyone: Here is what I ended up doing that not only retrieves the
MAC Address, but also solves a reported problem of being unable to quit
Apple System Profiler:

  In order to get the MAC Address from Apple System Profiler, you first need
to know that ASP refers to this as the "AppleTalk Address", and that it
returns the address in AppleScript's list format (ex:
{"00.0a.27.d6.9d.06"}). Secondly, you need to know where ASP *is*, otherwise
you'll get the dreaded "Please locate Apple System Profiler:" dialog box. I
discovered that if you can let MC locate it (through whatever means you
need - directories(), files(), etc.), you need to make sure that the default
directory is set to the location of ASP, otherwise you'll get the "Please
locate:" box.

  On my Mac (and I believe most modern OS8-9 Macs), ASP is located in the
Apple Menu Items folder. So here's the script (assuming MC has found it in
the Apple Menu Items folder):

  function GetMACAddress
    local tResult
    set the directory to specialFolderPath("apple")
    put "tell application" && quote & "Apple System Profiler" & quote & cr &
\
      "get appletalk address" & cr & "end tell" into getMACScript
    put "tell application" && quote & "Apple System Profiler" & quote & cr &
\
      "close window" && quote & "Apple System Profiler" & quote & cr & "end
tell" into quitASPScript

    set the directory to specialFolderPath("apple")
    do getMACScript as AppleScript
    put the result into retVal
    do quitASPScript as AppleScript
    replace "{" with "" in retVal
    replace "}" with "" in retVal
    replace quote with "" in retVal
    return retVal
  end GetMACAddress

  Note that although you can't send "quit" to ASP, you CAN say "close window
'Apple System Profiler'" and it does the same thing!

  Enjoy!

  Ken Ray
  Sons of Thunder Software
  Email: kray at sonsothunder.com
  Web Site: http://www.sonsothunder.com/
    ----- Original Message -----
    From: MisterX
    To: metacard at lists.runrev.com
    Sent: Thursday, February 21, 2002 12:07 PM
    Subject: RE: Unique Macintosh Identification


    just get the Mac Address of the network card. It's unique for each
hardware - model/manuf. regardless!
    You could also generate a time base code coupled with that just to make
sure it's never duplicate. I've heard of some duplicate ids in Mac addresses
but it's one in a zillion.


      -----Original Message-----
      From: metacard-admin at lists.runrev.com
[mailto:metacard-admin at lists.runrev.com]On Behalf Of Ken Ray
      Sent: Thursday, February 21, 2002 18:31
      To: metacard at lists.runrev.com
      Subject: Unique Macintosh Identification


      THis is slightly off-topic, but does anyone know how to uniquely
identify a Mac? We're trying to set up a specific install that works on a
set number of machines by getting a unique ID for the machine and using it
to verify that the machine is "licensed". This doesn't have to specifically
be through MetaCard (it could be AppleScript, XCMD, gestalt selector, etc.).

      Thanks!

      Ken Ray
      Sons of Thunder Software
      Email: kray at sonsothunder.com
      Web Site: http://www.sonsothunder.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.runrev.com/pipermail/metacard/attachments/20020222/4d77cae6/attachment.htm


More information about the metacard mailing list