Posts RSS Comments RSS 37 Posts and 56 Comments till now

Get the name of the computer in Tiger (10.4)

In certain AppleScripts you’ll find you need to get the name of the computer you’re currently on. Usually you need this for things like writing to logs, etc. Here’s how to do it in Tiger:

set theName to the computer name of the (system info)

This sets the variable “theName” to the name of your computer from the Sharing preference panel

Here’s an example. Paste the text below in Script Editor and run it.

set theName to the computer name of the (system info)
display dialog "My computer's name is " & theName
Add a Link:
  • Twitter
  • Facebook
  • Digg
  • Reddit
  • del.icio.us
  • Google Bookmarks
  • LinkedIn
  • StumbleUpon
  • Technorati
  • email

Comments are closed.

Trackback this post |