• 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: Problem with AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with AppleScript


  • Subject: Re: Problem with AppleScript
  • From: Christopher Nebel <email@hidden>
  • Date: Mon, 11 Dec 2006 23:14:44 -0800

Even better...

	tell application "System Preferences"
		-- substitute the localized name for "Accounts" if necessary.
		reveal pane "Accounts"

-- or, if you prefer, use this version which works regardless of the user's language selection.
reveal pane id "com.apple.preferences.users"
end tell


Yes, Virginia, System Preferences *is* scriptable, though only to manipulate the current pane.


--Chris Nebel AppleScript Engineering

On Dec 11, 2006, at 2:29 PM, Luther Fuller wrote:

You can open the Accounts preference pane with just this ...

tell application "Finder"
(path to library folder from system domain) as alias
open (file "Accounts.prefPane" of folder "PreferencePanes" of the result)
end tell


Now you have to use System Events only to click the unlock button.


On Dec 11, 2006, at 2:37 PM, Terry Sheltra wrote:

Hello everyone,

I wrote a small AppleScript utility to put on a new user's Mac that will automatically open up System Preferences in the Accounts pane, where they can change their password. The weird problem I am having is that the script works with no problems on my PowerBook G4, but when I run it on an Intel MacBook or MacBook Pro, I get the following error message:

NSReceiverEvaluationScriptError: 4

The script is as follows.  Sure hope someone can help me out!

Thanks!


activate application "System Preferences"

tell application "System Events"
	tell process "System Preferences"
		application "System Preferences"
		delay 0.5
		tell menu bar 1
			tell menu bar item "View"
				tell menu 1
					click menu item "Accounts"
				end tell
			end tell
		end tell
	end tell
end tell

activate application "System Preferences"

tell application "System Events"
	tell process "System Preferences"
		application "System Preferences"
		delay 1
		click button "Click the lock to make changes." of window "Accounts"
	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:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Problem with AppleScript
      • From: "John C. Welch" <email@hidden>
    • Help! Connecting to MS SQL Server
      • From: Rob Stott <email@hidden>
References: 
 >Problem with AppleScript (From: Terry Sheltra <email@hidden>)
 >Re: Problem with AppleScript (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: equivalence mv file_or_folder ~/.Trash and tell app "Finder" to move file_or_folder to trash
  • Next by Date: Help! Connecting to MS SQL Server
  • Previous by thread: Re: Problem with AppleScript
  • Next by thread: Help! Connecting to MS SQL Server
  • Index(es):
    • Date
    • Thread