Spotlight uses the Command-Spacebar shortcut by default, but you can change it if you like by going to System Preferences > Keyboard > Shortcuts > Spotlight >, double-clicking the keyboard shortcut next to Show Spotlight Search, and pressing a new key combination. It returns such a list when run on the command line like so :lsappinfo visibleProcessList You’ll need to do some text manipulation to extract the application names.Īs I checked, Indeed this command lists applications in window activating order.You can disable or rearrange categories for Spotlight searches in this preference pane. The only way that I’m aware of to obtain a list of running applications sorted by most recently active is by way of the shell command lsappinfo. Repeat this until the desired application is found. Therefore, I recommend you: hide also the processes found by my script and then get the front process again. Most likely, you do not get the application you need from my last scripts, because it is not 2nd, but 3rd in the window queue (or even 4th). It should be the key to solving your problem. Pay special attention to the app’s hide command (because for some reason, Launcbar.app doesn’t lose focus in any other way (for example, it has property visible=false persistently, maybe it is bug). Otherwise, the topic will quickly reach 100 posts without solving the problem. So that we test the same thing, not different things. And even if I learn in a week how to create an action, it will not be the one that you are testing.īetter post 3 screenshots of the 3 tabs of the New Action window (which I have already opened), as well as the script (as simple as possible). I suspect you want me, who is new to using the Launchbar app, to jump straight into the hard stuff. The choice of apps has no bearing on the sort order: I tried moving in an order from Finder to Console, then Chrome and run that script in the Script Editor. The apps I’m using are all visible, as I’m interacting with them. This is what I’ve found, and tried: tell application "System Events" to set visibleAppsToKill to name of every application process where visible is true (-10006)Īs for a list of running applications, that would be great, only if they were sorted by last time of focus, from which I could get the second entry in that array. I see what you did there, but AS didn’t like it: 64:88: execution error: System Events got an error: Can’t set process "Launchbar" to false. Tell process "Launchbar" to set its visible to false Set frontmostAppPath to (path to frontmost application) as textĭisplay dialog frontmostAppPath -> Macintosh HD:System:Library:CoreServices:Finder.app:īTW, to directly respond to the OP’s question, it’s a simple matter to get the frontmost application and a list of running (visible) applications, but I’ve never come across a way to get “second frontmost application”. Perhaps there is a flaw in my thinking? tell application "System Events" to tell process "Test" to set its visible to false My point is that setting the visible property of the frontmost app to false may not make the previously active app frontmost. I tried that with other apps active and always got Finder. I then modified the script as follows and, with Safari active, double-clicked on the icon, which returned “Macintosh HD:System:Library:CoreServices:Finder.app:”. set frontmostAppPath to (path to frontmost application) as textĭisplay dialog frontmostAppPath -> Macintosh HD:Users:Robert:Desktop:Test.app: With Safari active, I double-clicked on the app icon, which returned “Macintosh HD:Users:Robert:Desktop:Test.app:”. I don’t have launchbar installed but thought I might simulate the situation by creating and saving a script to the desktop as an app named “Test”.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |