• 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: truncate the hostname of local computer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: truncate the hostname of local computer


  • Subject: Re: truncate the hostname of local computer
  • From: David Andrews <email@hidden>
  • Date: Fri, 10 Dec 2004 00:45:50 -0500

This is similar to the "delete first 3 characters in a file name" thread currently under discussion.

A way to delete the ".local" from the file name:


set text item delimiters to "."
set {theName} to text items of "ghs27038.local"
set text item delimiters to {""}
theName --> "ghs27038"

David A


On Dec 9, 2004, at 7:13 PM, Steve Ingram wrote:

Our computers have the computer name set to eight characters - three letters followed by five numbers. Example: ghs27038

In a script we are using to reset the computer name I have the line:

set computerNameNoChange = `/bin/hostname`

This gives me a value of ghs27038.local

This is close to what I want. How do I get computerNameNoChange to equal only the first eight characters of /bin/hostname ?

More precisely, how do I get computerNameNoChange to be the value of the current computer name, without the ".local" added?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Hide process --> fullscreen game
      • From: jj <email@hidden>
References: 
 >truncate the hostname of local computer (From: Steve Ingram <email@hidden>)

  • Prev by Date: Re: Scripting Wireless Connectivity
  • Next by Date: Re: truncate the hostname of local computer
  • Previous by thread: truncate the hostname of local computer
  • Next by thread: Hide process --> fullscreen game
  • Index(es):
    • Date
    • Thread