Unique Macintosh Identification
Rob Cozens
rcozens at pon.net
Fri Feb 22 06:22:01 EST 2002
>Thanks, Roger. Unfortunately it means I'd need to launch another app and
>then make it quit just to get the serial number. Perhaps there's a gestalt
>reference out there? Then I could use a gestalt XCMD or equivalent...
Hi Ken,
I asked the List for a gestalt reference when I posted the AppleScript; but
no one responded. For $200 (last I checked) Apple tech support will
address a limited number of technical questions (4?); but I didn't want the
info bad enough to shell out the $$.
For completeness, here is the final AppleScript:
on getSerial()
tell application "Apple System Profiler"
run
copy SerialNumber to myNumber
close window 1
end tell
return myNumber
end getSerial
I'm only checking the serial # once on preOpen; so the delay to launch
AppleScript doesn't come into play once the user is in the stack.
BTW, if you do find a gestalt reference:
1. I'd like to know what it is.
2. You'll need different externals for OS<10 & OSX whereas one AppleScript
works on both Mac platforms.
PS: I told myself twice to ignore this, but I cant help comment:
>> I may have to write one extremely
>> simple and 100% reliable piece of C code to test the state of the mouse
>> button for my code and compile it as an external, I think I'll call it
>> "themouse"! After all, in the world of C it's quite straight forward, one
>> line I expect.
>
Do you not count variable declaration, external "glue", parameter
references when counting lines of C code. From my (dated & limited)
experience, one can't write anything useful in C in lass than half a page.
:{~)
Rob Cozens
CCW, Serendipity Software Company
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode
mailing list