[comp.sys.mac.programmer] Chooser name

shane@chablis.cc.umich.edu (Shane Looker) (09/29/88)

Oops.  Don't flame me too much, but I didn't save the answer given last
month to this question.

What resource in the System File has the Chooser Name stuffed in it.  Is
is a hard-coded number, or an owned resource of the Chooser?

Thanks.

Shane Looker   |  Looker@um.cc.umich.edu
"Subtle as a chainsaw, lacking all the social graces..."

ech@poseidon.UUCP (Edward C Horvath) (09/30/88)

From article <718@mailrus.cc.umich.edu>, by shane@chablis.cc.umich.edu (Shane Looker):
! Oops.  Don't flame me too much, but I didn't save the answer given last
! month to this question.

! What resource in the System File has the Chooser Name stuffed in it.  Is
! is a hard-coded number, or an owned resource of the Chooser?

The printer name (e.g. "ImageWriter") is in STR -8192; the userName for
your node is in STR -16096.  Both STRs are in the System file

=Ned Horvath=

rjohnson@seas.gwu.edu (Ray Johnson) (03/06/91)

How do you get the name of the machine as specified in the chooser?
In addition, is it possible for my application to set that name?

Any sample source code would help a great deal!

-- 
Ray Johnson
Internet: rjohnson@seas.gwu.edu       Phone: (202)994-6853
The George Washington University

smoke@well.sf.ca.us (Nicholas Jackiw) (03/09/91)

In article <2829@sparko.gwu.edu> rjohnson@seas.gwu.edu (Ray Johnson) writes:
>How do you get the name of the machine as specified in the chooser?

Try GetResource('STR ',-16096).  It's stored in the System File, which is
always accessible to your resource lookups (unless you've been playing
games).

Note that under System 7.0, this'll return the "Owner Name," not the
"Macintosh Name."



-- 
                              --- * ---
Nicholas Jackiw                Smoke@well.sf.ca.us | Jackiw@cs.swarthmore.edu
Key Curriculum Press, Inc.     Applelink: D3970    | (415) 548-2304
                              --- * ---

kahn@informatics.wustl.edu (Michael Kahn) (05/11/91)

How do I get the current Chooser name in MPW Pascal and ThinkC 4.0?  I
can't find i Toolbox call for it documented  anywhere in Inside
Macintosh or in any of the Tech Notes.  Have I missed it?

Sorry if this is a FAQ.
Michael Kahn
(kahn@informatics.WUSTL.EDU)

kmork@ulrik.uio.no (Knut Mork) (05/11/91)

The Chooser name is stored as a STR resource (or maybe a STR#) in the SYSTEM
file.  To access it, simply read in the resource.  I think the ID is -16096..
it's around there anyhow.  Look in resedit to be sure.

--Knut
-- 
| /  |\  /|   Knut Mork
|/   | \/ |   "The Master"
|\   |    |   aka Duthyn, Kaiser Knut, TRAP-R-JON-1, Forian
| \  |    |   kmork@ulrik.uio.no

peirce@outpost.UUCP (Michael Peirce) (05/11/91)

In article <1991May10.215035.28352@informatics.wustl.edu>, kahn@informatics.wustl.edu (Michael Kahn) writes:
> How do I get the current Chooser name in MPW Pascal and ThinkC 4.0?  I
> can't find i Toolbox call for it documented  anywhere in Inside
> Macintosh or in any of the Tech Notes.  Have I missed it?

The Chooser name is stored in the system file as STR ID = -16096.
You can fetch it using the GetString(-16413) trap which returns a
handle to the string.

Note that in System 7, they've modified this scheme somewhat.  Rather
than a "Chooser Name", there are now two names: a "Owner Name" stored
in STR ID = -16096 and a "Macintosh Name" stored in STR ID = -16413.

-- michael

--  Michael Peirce         --   outpost!peirce@claris.com
--  Peirce Software        --   Suite 301, 719 Hibiscus Place
--  Macintosh Programming  --   San Jose, California 95117
--           & Consulting  --   (408) 244-6554, AppleLink: PEIRCE