5.2 - Window Management
5.2 - Window Management
So window management is a little strange in Shortcuts.
I've gotten a single action here: open up Safari, and open it to MacSparky. So if I run that, it's going to open up Safari to MacSparky. Great.
But what if I want to move that window around the screen. Now normally, if I search for window, you can see under Scripting, we've got some window actions here. I could just move the window, right? That's the assumption, at least, is that ... here, let me pull that back in, there we go.
Alright, we want to move the window to center. But the problem is, you can't identify the window that you're moving. Even though you just opened up Safari in the prior step, Shortcuts isn't quite smart enough to figure out what you're talking about.
Instead, you need to show it the window that it's moving. And you do that with the Find Windows action. So I'm going to drag that in. And we're going to add a single filter here, where the app name is Safari. And now that I've done that, that is something I can tap into. And you can see it even already figured out I'm moving that window to the center. And if I want, I can double tap on that and give that a better name, so I'm going to name it Safari Window. And we're going to do that. We're going to move to the center. You can do ... put it in a lot of places, but I think center is a good place to read the web.
So now, if everything works, it will open up Safari. It'll be where it was last time, on the left side of the screen, and it should move over to the right. And it didn't work. Let me run it one more time. And that time, it did work. So I think the problem there is, it just it took too long to load the page and the action to move the window didn't have time to work.
So let me go over here. And I'm going to add a Wait command. And that's the problem when you're dealing with the web is, you need to give everything a little bit of time. And let's go ahead and make that two seconds. And it'll work now because Safari is already in memory. And it'll jump over real quick. I'm going to move it back over. I'm going to close the window so as to reload it.
Let's see if it works now. So it's going to load Safari, wait two seconds, and then move to center. Well, sometimes you've got to compromise for the internet. That is the Window Movement actions. If I wanted to move it to the bottom right, I could do that too. Let's run that. It's gonna wait two seconds, then move. And because of the way I've set the dimensions of the screen for screencasting, bottom right is basically the whole right side of the screen. But if you've got your screen set for bigger resolution than I'm using right now, that would actually work.
So there's really two ways to manage windows with Shortcuts. There's this method right here where you have a lot more control about where you put it on the screen. There's also that split screen command which I've shown you in other screencasts. I'll use them both throughout the series and this course, so you'll get to know them.
So Window Management is a new thing on the Mac. You do have split screen on the iPad, but not Window Management. And it does require you to find the windows before you move them, but Shortcuts is completely up to the task of moving your windows for you.