• 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: Change computer name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change computer name


  • Subject: Re: Change computer name
  • From: Mat <email@hidden>
  • Date: Tue, 22 Apr 2003 16:07:46 -0400

As a total AppleScript newbie, I came up with this script to help me change
the computer name (for both rendezvous and appletalk):


------------------------
tell application "Finder" to activate the application "System Preferences"
tell application "System Preferences"
set hostname to ""
display dialog ,
"Enter a hostname for both Computer Name and Rendezvous Name" &
return & "Try to not use any special character like ,
< /!@#$%^&*()_ .> but you can use < - >" default answer the hostname
copy the text returned of the result to hostname
end tell

tell application "System Events" to tell process "System Preferences"
click menu item "Sharing" of menu "View" of menu bar 1
delay 3
set the value of text field 1 of window 1 to hostname
set the value of text field 2 of window 1 to hostname
end tell

tell application "System Preferences" to quit
-------------------------


It is more of a cheap workaround than a real script ;)

Hope this helps

Mat



Le 31/12/1969 20:40, + Jean-Baptiste LE STANG ; <email@hidden>
a icrit :

> I naively tried the following
>
> -> get the computer name
>
> wich was compiled in
>
> -> get system attribute name
>
> which returned
>
> -> {"HOME", "SHELL", "USER", "LANG", "PATH", "__CF_USER_TEXT_ENCODING"}
>
> Any explanation about this is welcome, what's the aim of 'system
> attribute' ? (I must admit that I've been ignoring it for a long time)
>
> JB
>
> Le mardi, 22 avr 2003, ` 12:05 Europe/Paris, Chris Hall a icrit :
>
>> Hey:
>>
>> How do I change the computer name that shows up in the Sharing sys
>> prefs?
>>
>> Thanks,
>> Chris
>> _______________________________________________
>> applescript-users mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/applescript-users
>> Do not post admin requests to the list. They will be ignored.
> _______________________________________________
> applescript-users mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/applescript-users
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: stop a print job in OSX ? re: lprm, whatis and cancel
  • Next by Date: Re: stop a print job in OSX ? re: lprm, whatis and cancel
  • Previous by thread: Change computer name
  • Next by thread: Rép : Dropin'
  • Index(es):
    • Date
    • Thread