• 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
What's the difference in these?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What's the difference in these?


  • Subject: What's the difference in these?
  • From: Brian Christmas <email@hidden>
  • Date: Mon, 04 Apr 2016 15:20:24 +1000

G’day scripters

This applescript works to open a pop-up button on my app.

tell application "Mail Manager"
activate
tell application "System Events" to tell process "Mail Manager"
click pop up button 1 of window 1
click ((some menu item of menu 1 of pop up button 1 of window 1) whose name contains "Sales")
end tell
end tell

but when I embed the same code in the ASObjC app itself, it crashes, with...

System Events got an error: Can’t get window 1 of process "Mail Manager". Invalid index.

try
tell me
activate
set p to 0
tell application "System Events" to tell process "Mail Manager"
set p to 1
try
say (count of windows) -- < 'zero'
end try
click pop up button 1 of window 1 — < tried ‘0'
set p to 2
click ((some menu item of menu 1 of pop up button 1 of window 1) whose name contains theEmailToFetch)
end tell
end tell
on error errmsg
if runForOz then display dialog errmsg & " p = " & p


I’ve exhausted all the different methods I can think of.

Any tips on how I SHOULD use the code, please?

Regards

SANTA
And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: What's the difference in these?
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Is it possible to get mouse click position in Scroll View?
  • Next by Date: Re: What's the difference in these?
  • Previous by thread: Re: Is it possible to get mouse click position in Scroll View?
  • Next by thread: Re: What's the difference in these?
  • Index(es):
    • Date
    • Thread