Jump to content
KelvinZhao

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!

Share this post


Link to post

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?

Share this post


Link to post
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.

Share this post


Link to post
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 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post

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!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...