Jump to content

Selecting the last selected window/app?


Recommended Posts

Hi guys,

 

I'm using the spectacle app to control/move my windows around, but it's hard to remember all the different shortcut keys to move the windows, so I tried writing a short script in Alfred to enter the keys for me, so I can just type, move top left, etc and the hotkeys will be activated.

But the problem is when I activate Alfred to produce that command, the window I want to move is no longer the 'active' window.

How can I hit the command and it select the last selected window or app and push the shortcut there?

 

Many thanks in advance!

Link to comment
1 hour ago, nikivi said:

You can also use this amazing alfred workflow (https://transfer.sh/lmX9v/layout.alfredworkflow) to do the same for you.

 

I’m not sure I have tried that one in particular, but Alfred Workflows for this always left a lot to be desired, to me. Apart from usually missing features that Spectacle has and being a pain to configure, they tend to be dog slow in comparison. My brain is so used to Spectacle’s native performance that when I used one of those (typically AppleScript) Workflows, after pressing the shortcut my brain would go “why didn’t anything happen?” and then it’d happen. Or I’d be arranging windows and be too fast for the Workflow to keep up, leaving everything a mess.

Link to comment
1 hour ago, vitor said:

 

I’m not sure I have tried that one in particular, but Alfred Workflows for this always left a lot to be desired, to me. Apart from usually missing features that Spectacle has and being a pain to configure, they tend to be dog slow in comparison. My brain is so used to Spectacle’s native performance that when I used one of those (typically AppleScript) Workflows, after pressing the shortcut my brain would go “why didn’t anything happen?” and then it’d happen. Or I’d be arranging windows and be too fast for the Workflow to keep up, leaving everything a mess.

Oh I do agree with you. I actually use BetterTouchTool and Keyboard Maestro for all my window management. I just use layouts to do some very specific layouts that I don't have a hotkey binding for. Things like that : 

 

f1ccfgo.png 

Link to comment
13 hours ago, deanishe said:

Have you tried adding a Hide Alfred action between your triggers and your scripts? Perhaps also adding a small delay to your scripts to give Alfred time to disappear and return focus to the previous app?

 

Hi deanishe,

 

I'm assuming you mean hide the Alfred window after you enter your commands (and before the queries hit the scripts)? How do you do that? I can't seem to find a command to slot in between the flow.

 

Thanks to everyone who replied too! I'm checking out some of the suggested apps and workflows too. =D

Link to comment
6 hours ago, KelvinZhao said:

you mean hide the Alfred window after you enter your commands (and before the queries hit the scripts)? How do you do that?

 

Right click to add a new node → UtilitiesHide Alfred.

Link to comment

Oops, my iMac went dead. Finally fixed.
 

I tried adding the hide Alfred, but it seems after hiding it didn't go back to the last selected window but defaulted to the finder so my shortcuts to activate Spectacle didn't work after all. Sad. Haha. Will try to find some other way to do this I guess.

Still, thanks for the suggestions guys!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...