Sign up ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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_('').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?

share|improve this question

2 Answers 2

up vote 11 down vote accepted

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
share|improve this answer
That's what I want. Thanks. By the way, where can I find the documentations of the actions? – Pink Jul 31 '12 at 13:49
Accessibility Roles and Attributes Reference: Actions. You can see what actions UI elements support with actions of or by using Accessibility Inspector. – ؘؘؘؘ Jul 31 '12 at 13:53
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) ??? – Motti Shneor Oct 28 at 11:28

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. :)

share|improve this answer
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. – Pink Jul 30 '12 at 0:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.