FW: Set Focused of Static Text
FW: Set Focused of Static Text
- Subject: FW: Set Focused of Static Text
- From: Jeffrey Berman <email@hidden>
- Date: Tue, 28 Jun 2005 06:12:17 -0500
There have been no responses to my question below. Does anyone have an
example in which they were able to set the 'focused' property of a static
text item or is this just a known bug of UI scripting?
-Jeffrey Berman
----- Forwarded message follows -----
From: Jeffrey Berman <email@hidden>
Date: Sat, 25 Jun 2005 08:35:13 -0500
To: AppleScript Users List <email@hidden>
Cc: Jeffrey Berman <email@hidden>
Subject: Set Focused of Static Text
Is it possible to set the focus of a static text element when doing UI
scripting? In the System Events dictionary, the 'focused' property is
listed as a boolean and it is not read only.
However, I am having no luck with the following on OS 10.3.9:
tell application "System Preferences"
activate
set current pane to pane "com.apple.preferences.Bluetooth"
end tell
tell application "System Events"
tell window "Bluetooth" of process "System Preferences"
set focused of static text 1 of radio group 1 ¬
of scroll area 1 of scroll area 1 of browser 1 ¬
of splitter group 1 of tab group 1 to true
end tell
end tell
The script results in an error dialog with the text "System Events got an
error: NSInternalScriptError".
If I manually set or unset the focus of this static text item, I can confirm
with a 'get' command that the focused value of the item changes. But I
can't seem to set it by script.
When I did a Google search, I found that someone had reported a similar
problem with setting the focused of a static text item in the Displays
preference pane:
http://groups-beta.google.com/group/alt.comp.lang.applescript/browse_frm/thr
ead/aad06339e722895d/96acd69d3d6b8acf?q="static+text"+focused+true+set+a
pplescript&rnum=1&hl=en#96acd69d3d6b8acf
In that case, the better alternative was to use commands from
ColorSyncScripting and avoid UI scripting altogether. Unfortunately, that
solution is not available for the Bluetooth preference pane.
So, anyone know how to set the focused of a static text item?
-Jeffrey Berman
----- End of forwarded message -----
_______________________________________________
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