• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: weird UI scripting problems.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: weird UI scripting problems-- solved
      • From: Deivy Petrescu <email@hidden>
References: 
 >Re: weird UI scripting problems. (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: weird UI scripting problems.
  • Next by Date: importing new video track with Quicktime
  • Previous by thread: Re: weird UI scripting problems.
  • Next by thread: Re: weird UI scripting problems-- solved
  • Index(es):
    • Date
    • Thread