New GUI Scripting
New GUI Scripting
- Subject: New GUI Scripting
- From: email@hidden
- Date: Sat, 21 Dec 2002 14:47:52 -0800
I've just updated to OS X 10.2.3 and installed the Dec. Dev tools and the
new System Events.app and the new Script editor but I'm have problems
getting the new UI scripting to work.
I keep getting the error "NSReceiverEvaluationScriptError(4)". Anyone
got any ideas on how to get it working (or has anyone got it to work
yet?). This is just trying the scripts from the apple webpage about the
UI scripting and the examples from the dev tools.
I've tried the following two scripts among other things and I get the
same error:
------------------------------------------------------------------------
-- bring the target application to the front
try
tell application "Finder"
activate
select Finder window 1
end tell
tell application "System Events"
tell process "Finder"
click (the first button of the front window whose
subrole is "AXToolbarButton")
end tell
end tell
on error error_message number error_number
tell application "Finder"
display dialog error_message buttons {"OK"} default button
1
end tell
end try
------------------------------------------------------------------------
tell application "System Preferences"
activate
end tell
tell application "System Events"
get properties
tell process "System Preferences"
click menu item "My Account" of menu "View" of menu bar 1
delay 3
get name of static text 5 of window "My Account"
end tell
end tell
------------------------------------------------------------------------
Thanx, SDerman.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.