• 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: Time to figure out what is going on... (results)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Time to figure out what is going on... (results)


  • Subject: Re: Time to figure out what is going on... (results)
  • From: deivy petrescu <email@hidden>
  • Date: Mon, 22 Aug 2005 19:35:54 -0400


On Aug 22, 2005, at 19:25, David Marshall wrote:

On Mon, 22 Aug 2005 11:55:15 -0700, Matt Neuburg wrote:


I tried this:

tell application "Mail" to activate
tell application "System Events"
 tell application process "Mail"
  click menu item "New Viewer Window" of menu 1 of
    menu bar item "File" of menu bar 1
 end tell
end tell

Runs fine in the Script Menu. m.



I did exactly the same, with the same result. However, when I tried the equivalent excerpt from Glenn's script--


tell application "System Events"
      tell process "Mail"
            activate
            click menu item "New Viewer Window" of
menu 1 of menu bar item "File" of menu bar 1
       end tell
end tell

--that _also_ worked fine from the Script Menu; the only difference was that in the first case, the script ended with Mail frontmost, and in the second case, the frontmost app prior to the running of the script remained frontmost (actually, I believe Mail came to the front for the blink of an eye, mid-script).

- - - - -

Dave

To "activate" a process in System events use:

tell application "System Events"
    set frontmost of process "Mail" to true
end tell


"activate" works with the application not with a process.

Try this

tell application "Finder"
    set frontmost of process "Mail" to true
end tell

--> activates "Finder"



deivy
_______________________________________________
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


References: 
 >Re: Time to figure out what is going on... (results) (From: David Marshall <email@hidden>)

  • Prev by Date: Re: Finder Scripting
  • Next by Date: Weird error reading files
  • Previous by thread: Re: Time to figure out what is going on... (results)
  • Next by thread: Weird error reading files
  • Index(es):
    • Date
    • Thread