• 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: machine name and user
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: machine name and user


  • Subject: Re: machine name and user
  • From: Christopher Stone <email@hidden>
  • Date: Mon, 13 Aug 2012 22:02:13 -0500

On Aug 13, 2012, at 16:30, Bob Cuilla <email@hidden> wrote:
I am trying to retrieve the current machine name and user.  Does anyone know the proper syntax to get that info.
______________________________________________________________________

Hey Bob,

set {compName, shortUserName, longUserName} to {computer name, short user name, long user name} of (get system info)

# OR

tell (system info)
set {compName, shortUserName, longUserName} to {computer name, short user name, long user name}
end tell

# OR

tell (system info)
set compName to computer name
set shortUserName to short user name
set longUserName to long user name
end tell

Here's the whole thing as text:

on getSysInfoReport()
try
(system info) / 0
on error eMsg
set sysInfo to eMsg
end try
set AppleScript's text item delimiters to {"{", "}", ", "}
set sysInfo to text items 2 thru -2 of sysInfo
set AppleScript's text item delimiters to return
set sysInfo to sysInfo as text
return sysInfo
end getSysInfoReport

getSysInfoReport()

--
Best Regards,
Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >machine name and user (From: Bob Cuilla <email@hidden>)

  • Prev by Date: Re: OS X 10.8 Security & Applescripts - "unidentified developer"
  • Next by Date: Re: Mail's mailbox list
  • Previous by thread: Re: machine name and user
  • Next by thread: Re: machine name and user
  • Index(es):
    • Date
    • Thread