Re: weird UI scripting problems.
Re: weird UI scripting problems.
- Subject: Re: weird UI scripting problems.
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 11 Nov 2003 06:56:02 -0500
Why are you bringing the System Events application to the front before
scripting the "Windows Media Player" process? In some situations, I believe,
GUI Scripting will only work when the targeted process is frontmost.
However, my experiments reveal that GUI Scripting simply doesn't work on the
new Windows Media Player 9, anyway. 'get attributes of window 1', for
example, under Panther. I'm puzzled by this, since UI Browser easily and
correctly reads its elements and attributes using the Accessibility API, on
which GUI Scripting is based.
on 2003-11-10 8:05 PM, Deivy Petrescu at email@hidden wrote:
>
> The second problem is with UI scripting and Windows Media Player.
>
>
>
> the following script errors:
>
>
>
> tell application "Windows Media Player" to activate
>
> tell application "System Events"
>
> set frontmost to true
>
> tell process "Windows Media Player"
>
> return title of menu bar 1's menu 5
>
> end tell
>
> end tell
>
>
>
> --> get title of menu 5 of menu bar 1 of process "Windows Media Player"
>
> --> "System Events got an error: NSReceiverEvaluationScriptError: 4"
>
>
>
> However this works
>
>
>
> tell application "Windows Media Player" to activate
>
> tell application "System Events"
>
> set frontmost to true
>
> tell process "Script Editor"
>
> return title of menu bar 1's menu 5
>
> end tell
>
> end tell
>
>
>
> --> get title of menu 5 of menu bar 1 of process "Script Editor"
>
> --> "View"
>
>
>
>
>
> UI Element Inspector shows both menus 5 as being "titled" "View".
>
> I really do not understand the problem.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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.