Lock Icon/Button

Any idea how to add a lock button similar to that found in apple applications and other xcode apps I’ve seen? To be specific I know how to emulate the functionality, but wondering if anyone knows where to find the actual animated icon(?) they are using or if its a setting somewhere in AppleScript Studio.

James,

asuming you’re talking of this … it’s a view from SecurityInterface.framework. I have never used it from AppleScript studio yet, but it might be possible. Here’s how to start:

  1. add the framework to your project
  2. drop it’s SFAuthorisationView.h file on your nib in Interface Builder
  3. add a custom view in IB - make it about 300 px wide (other wise the text won’t fit …)
  4. connect the view to an awake from nib handler
  5. add these lines:
on awake from nib theObject
	call method "setString:" of theObject with parameter "system.privilege.admin"
	call method "setAutoupdate:" of theObject with parameters {true}
end awake from nib

Now run and compile and you will see the admin password dialog and when successfully entered the opening lock animation. But that’s only the visual part … I am currently unsecure if this will leed to success in the end since I have no idea to connect it’s functionylity to a script atm.

Dominik

Are you just looking for the actual image file of the lock icon? If so, check in the directory /System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/ for lots of security-related icons… most notably those starting with “Lock_”.

j