Another simple question

i just need to click that button. I thought it would look something like this, but its not compiling.


tell application "SafariScript Installer"
	activate
	 click button "Install" of window "SafariScript 1.2"
end tell

<AXApplication: “SafariScript Installer”>
<AXWindow: “SafariScript 1.2”>
<AXButton: “Install”>

Attributes:
AXRole: “AXButton”
AXRoleDescription: “button”
AXHelp: “(null)”
AXEnabled: “1”
AXFocused (W): “0”
AXParent: “<AXWindow: “SafariScript 1.2”>”
AXWindow: “<AXWindow: “SafariScript 1.2”>”
AXTopLevelUIElement: “<AXWindow: “SafariScript 1.2”>”
AXPosition: “x=758 y=468”
AXSize: “w=82 h=32”
AXTitle: “Install”

Actions:
AXPress - press

Usually you would do this type of UI scripting through System Events. It would look something like this (I do not have SafariScript Installer, so I did not test it):

-- Start and/or bring the installer app to the front
tell application "SafariScript Installer" to activate

-- Click the install button
tell application "System Events"
	tell application process "SafariScript Installer"
		click button "Install" of window "SafariScript 1.2"
	end tell
end tell

Does that help? An AppleScript application object is not the same as a System Events application process (sometimes just process) object. The AppleScript one is for application scripting and the System Events one is for UI scripting.

Model: iBook G4 933
AppleScript: 1.10.7
Browser: Safari 3.0.4 (523.12)
Operating System: Mac OS X (10.4)

Hi, esamuels.

Would you mind giving your posts more informative subject lines? (See the Posting Guidelines, linked at the top of each page of these fora.) In this thread, for instance, the subject should indicate that you’re asking about clicking a button in a particular application. :slight_smile:

NG
Yea, don’t mind at all. Sorry about that.

chrys
That’s exactly it. I knew it’d be a simple solution. Dunno why I missed the tell application “System Events” part. But that makes sense.