make a window stay on top

I've written a small terminal process (Pascal command level program running under Terminal ) that I would like to have remain on top of all other app displays on the screen, at least until I terminate/quit it. Is there a script or something that can set the environment to cause that behavior?

iMac (21.5-inch, Late 2012), OS X Mountain Lion (10.8.5)

Posted on Nov 1, 2013 8:27 PM

Reply
12 replies

Nov 2, 2013 4:08 PM in response to LorInCalif

AFAIK, nope. Barring full-screen, which probably isn't what you want.


In 10.8 and later, one common approach for putting up a notification of the status of some long-running activity would be the use of Notification Center and NSUserNotificationCenter (or an add-on that allows notification center messages or via Automator), or using the Growl tool (available via the App Store) and either a Growl API call or growlnotify.


FWIW, here's the Human Interface Guidelines, which is how applications on OS X are intended to be designed. Pinning a modal dialog or an alert or panel at the front of all windows isn't part of the preferred design for OS X applications, and you won't find much in the way of system-wide modal APIs to do that short of some hackery — these sorts of alerts and the closely-related "splash screens" just aren't common on OS X, and intentionally (and thankfully) so. OS X very intentionally defers to the user preferences here; the user decides what's on the top of the displays.

Nov 2, 2013 2:31 PM in response to LorInCalif

You could put the terminal window in its own space then switch to that space to view the program. It will always be on top in its own space.


Otherwise there is no way in OS X to keep a window on top. There is a third party app, Afloat, that gets mentioned when you search for this but it seems like it's source only and gets mixed reviews.


This Google search mac os x keep window on top will bring up discussions about it and links to the developers site.

Nov 2, 2013 7:37 PM in response to MrHoffman

I appreciate the Human Interface Guidelines, and I agree they are a good approach to app design. That said, my use for a persistent interactive process would be a huge help in the activity I'd use it for. To wit, video editing. While editing, one needs a full screen presentation for all of the various elements that are continually bounced between to get the job done. Of great assistance will be a simple calculator for doing timecode math. Timecode is an expression for a single frame of video identified as hour:minute:second:frame. This is not a trivial math element, yet vital to the editing process. I have writen the math program and it work svery well, except for the need to move the cursor to, and then click into the timecode math terminal window, and go back similarly. I have been making the editing window smaller and placing the math window underneath. Moving back and forth with those extra clicks like that every couple of minutes is quite irritating. Floating the the math window on top of a little used area of the editing window would help a lot. It would be even better if the floating window automatically took the user input without requiring the intro mouse click, and gave it up when the cursor moves off, thus behaving as though it were an integral part of the editing app.
So, nice as the interface guidelines are, they are apparently inadequate to provide this functionality. Or, am I wrong?

Nov 5, 2013 8:54 AM in response to Frank Caggiano

For others who may have this requirement, I am now successfully using Afloat in OSX 10.8.5. After a lengthy search and trials and errors, I suceeded with:


Afloat 2.4 from https//www.macupdate.com/app/mac/22237/afloat

and

EasySIMBL from https//github.com/norio-nomura/EasySIMBL


Both are needed.


After downloading Afloat and expanding the .zip,

launch Afloat.xcodeproj and do a build to run,

and the same with AfloatScripting.xcodeproj.

(I'm not sure whether you need to build both of them, but it didn't hurt.)


Put Afloat.bundle into your user Library/Applications Support/SIMBL/Plugins folder.

Put EasySIMBL into your Applications folder.


Works like a charm, although it doesn't eliminate the need to click in to interact with the floating window and to click back in to any window it's floating above - but that would be asking a lot.


Thanks Frank Caggiano. BTW, what does the Sanscrit say? Or is it some S.E. Asian script?

Dec 14, 2013 6:44 PM in response to LorInCalif

Thanks for posting this! Got it to work, it's great. I also used this link from apple.stackexchange.com to build the Xcode project manually, instead of using Xcode, which was even easier (follow the Terminal command shown in the link). However, I did get Microsoft Excel crashing repeatedly when I had the "use SIMBL" option checked in EasySIMBL. I didn't test any other Office products, but once I unchecked that option Excel didn't crash anymore. I'm running OS X 10.8.5. Here's a link from the developer explaining that he didn't have any more time to keep up development on it.


Evan

Sep 12, 2014 4:39 PM in response to LorInCalif

Thanks, LorInCalif!!! I've been looking all over for specific instructions on how to make this work. Floating windows are essential in my workflow and I was worried that there was no solution available for the Mac.


To avoid the SIMBL compiling, I used another SIMBL source (http//www.culater.net/software/SIMBL/SIMBL.php) and it worked perfectly. I'm new to Mac app dev, so I took me bit to find the Afloat.bundle file from XCode output, but once I found that, it worked perfectly. Thanks, again!


Mark

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

make a window stay on top

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.