I want to bring a window (QuickTime for example) to frontmost, without focusing it. I can do it in OS X 10.7 using the following code in Applescript.

tell application "System Events"
    set visible of process "QuickTime Player" to true
end tell

This is a Python equivalent.

from ScriptingBridge import *
process = SBApplication.applicationWithBundleIdentifier_('com.apple.systemevents').processes().objectWithName_('QuickTime Player')

But it does not work after I upgraded to OS X 10.8. Is there any way to make it work?

2 Answers 2


If an application has open windows, this should raise them above windows from other applications, but keep them below ones from the current application.

tell application "System Events"
    perform action "AXRaise" of window 1 of process "QuickTime Player"
end tell
  • That's what I want. Thanks. By the way, where can I find the documentations of the actions? Commented Jul 31, 2012 at 13:49
  • 1
    Accessibility Roles and Attributes Reference: Actions. You can see what actions UI elements support with actions of or by using Accessibility Inspector.
    – Lri
    Commented Jul 31, 2012 at 13:53
  • 1
    AXRaise is not permitted in OS X 10.10 (Yosemite) and 10.11 (El-Capitan) unless you added the calling application (the one that executes the AppleScript) to the "Accessibility" section of the "Privacy" tab of the "Security & Privacy" System Preferences panel. This means that the first time you'll try to do it - you'll be presented with system UI that will suggest to take you to the preferences. I can't use it because of the detour in user-experience. Is there another way to raise the window without using AX (accessibility API's) ??? Commented Oct 28, 2015 at 11:28
  • is it possible to just raise the second window of an app? I tried with "window 2" which cycles through them while "window 1" only brings the last window of the app which was in front of it's other windows.
    – Markus
    Commented Oct 13, 2021 at 9:48

So, from what I gather from your post, you are trying to bring an application into view using Applescript? If so, the code for this in Mountain Lion is actually fairly simple! Here it is:

tell application "Quicktime Player"
end tell

I hope this works! If it's not what you wanted, let me know and I'll update it for you. :)

  • 2
    Well, activate will focus Quicktime, so it is not what I want. I mean, if you open Applescript application, type your code and run it, window focus will be moved to Quicktime. As a result, you cannot type any code before you click the Applescript window for example. Commented Jul 30, 2012 at 0:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .