Jump to content

Workflow that allows me to launch apps in certain workspaces in macOS


Recommended Posts

Hello,

 

Is there a way of configuring a workflow in Alfred that will launch a new workspace (or tab - I’m not sure what they are called in macOS) and launch specific applications within that workspace?

 

Please advise,
Jason

Link to comment
Posted (edited)
1 hour ago, jswifty said:

a new workspace (or tab

 

Those are wildly different things. Are you referring to spaces?

 

If so, there’s no programatic way to do what you ask. Closest you can get is GUI automation, faking keypresses and clicks to create a new space. But launching apps there is a whole different matter. To use the code in that post, copy the bottom block (“For other languages”) in a Run Script Action with /usr/bin/osascript (AppleScript) as the Language. Try it in the Script Editor app first to see how it works.

 

For better ways than that, you’ll need to open the Feedback Assistant app and make a request to Apple.

Edited by vitor
Link to comment
Posted (edited)

Hi Jason,

 

Closest I can get you is opening an app full screen in its own space in a fairly clunky way with a script filter to pick the app and then some AppleScript to as @vitor says "Fake the button presses"


https://github.com/pearcenuk/Alfred-public/blob/main/FullScreen/FullScreen.alfredworkflow

 

Launch by typing "fs" and choose your app from there.

 

BetterTouchTool or KeyboardMaestro might be able to do more of what you need.

Edited by Pearcen
Link to comment
20 minutes ago, Pearcen said:

BetterTouchTool or KeyboardMaestro might be able to do more of what you need.

 

Checked BetterTouchTool, and its solution is pretty much the same as the AppleScript from the linked Stack Overflow (acts the same).

Link to comment
Posted (edited)

Have just noticed my very quick and dirty bash script to get to the app names doesn't take into account apps with a space in the name App Store.app comes out as 2 things: App and Store.app

 

🤦‍♂️

 

I'll fix it up soon.

 

EDIT: Updated workflow to my first love Perl and it works now.

https://github.com/pearcenuk/Alfred-public/blob/main/FullScreen/FullScreen.alfredworkflow

 

Edited by Pearcen
Link to comment
10 hours ago, Pearcen said:

Updated workflow to my first love Perl and it works now.


Fun to see a Workflow in Perl! But keep in mind that’s one of the scripting languages Apple mentioned they will eventually remove from macOS.

Link to comment
3 minutes ago, vitor said:


Fun to see a Workflow in Perl! But keep in mind that’s one of the scripting languages Apple mentioned they will eventually remove from macOS.

True, true. I'll update one day, but until that day it does the job nice and simply. 😆

Perl shows my age.

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...