• 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
Inventory script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inventory script


  • Subject: Inventory script
  • From: Gabe Lucero <email@hidden>
  • Date: Wed, 15 Jun 2005 15:41:42 -0700

Title: Inventory script
Hello,

I’ve been working on a script that was posted for schools to run after then image a computer. It’s a very handy little script that pulls the serial number of a computer, asks some questions and puts the replies in the Computer Info fields in the Apple Remote Desktop section of the Sharing Preferences.

This script worked great in Panther but in Tiger it returns - NSReceiverEvaluationScriptError: 4

Can someone help me out and tell me where the script goes wrong? I understand that UI scripting in not on by default in Tiger but even after I turn it on I still get the error. The part that returns the error is where it says - click button "Access Privileges..." of tab group 1 of window "Sharing"

Thanks

tell application "System Profiler"
    set SN to system profile
   last word of (paragraph (count paragraphs in (text 1 thru (offset of "Serial Number" in SN) of SN)) of SN)
end tell

set result to display dialog "What is the name of this computer?" default answer ""
set TheName to text returned of result

set result to display dialog "What is the Tag# of this computer?" default answer ""
set TheTag to text returned of result

set result to display dialog "What is the Location/Room# of this computer?" default answer ""
set Location to text returned of result

tell application "System Preferences" to activate
tell
application "System Events"
    get properties
   tell application process "System Preferences"
        click button "Sharing" of scroll area 1 of window "System Preferences"
        delay 3
        click button "Edit…" of window "Sharing"
        set value of text field 1 of sheet 1 of window "Sharing" to TheName
       click button "OK" of sheet 1 of window "Sharing"
        click button "Access Privileges..." of tab group 1 of window "Sharing"
       delay 3
        set value of text field 1 of group 2 of sheet 1 of window "Sharing" to TheName
       set value of text field 2 of group 2 of sheet 1 of window "Sharing" to TheTag
       set value of text field 1 of group 1 of sheet 1 of window "Sharing" to Location
       set value of text field 2 of group 1 of sheet 1 of window "Sharing" to SN
       click button "OK" of sheet 1 of window "Sharing"
        keystroke tab -- forward tab key
   end tell
end
tell

 _______________________________________________
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:
    • Re: Inventory script
      • From: CYB <email@hidden>
    • Renaming QuarkXPress to QuarkXPress 6.5
      • From: Jason Bourque <email@hidden>
  • Prev by Date: Persistent window bounds on disk image Finder windows
  • Next by Date: Renaming QuarkXPress to QuarkXPress 6.5
  • Previous by thread: Persistent window bounds on disk image Finder windows
  • Next by thread: Renaming QuarkXPress to QuarkXPress 6.5
  • Index(es):
    • Date
    • Thread