Jump to content

[Request] Minimize windows of a selected app


Recommended Posts

Hi there,

 

I think it would be great to be able to minimize windows directly from Alfred, since it can otherwise be done only for the active application.

 

Here's my idea: this workflow would work very similarly to the quit keyword (say, with a mini keyword). Thanks to a script filter maybe, Alfred would show the list of running processes. When hitting return on one of them, all the windows of this process would be minimized.

 

Do you have any idea how to achieve that? Thanks!

Link to comment

Take the "running" workflow that is in this forum, feed it's output to a AppleScript that minimized that applications windows. Should be easy, but I am traveling right now and not at my Mac (I have a PC netbook. I really need to upgrade!). If no one supplies it by the time I get back, I will put it together for you.

Link to comment

Take the "running" workflow that is in this forum, feed it's output to a AppleScript that minimized that applications windows. Should be easy, but I am traveling right now and not at my Mac (I have a PC netbook. I really need to upgrade!). If no one supplies it by the time I get back, I will put it together for you.

 

Which running workflow are you referring to? Then I think I can handle the AppleScript part.

Link to comment

I think it's this one #1

Scroll down a bit to

 

running-apps

Lists all of the running OS/X applications (not processes, what OS/X considers as a running app). Selecting one will activate the application. Holding down the alt modifier key will trigger the built-in 'quit' Alfred command.

Responds to the keyword 'running'.

Link to comment

I think it's this one #1

Scroll down a bit to

 

running-apps

Lists all of the running OS/X applications (not processes, what OS/X considers as a running app). Selecting one will activate the application. Holding down the alt modifier key will trigger the built-in 'quit' Alfred command.

Responds to the keyword 'running'.

 

That is the one. The apple script in it gets the name of the process from the script filter. Just make another applescript with the command key modifier to run it that will minimize that application. It should not be hard. I will not have time until Monday to look at it.

Link to comment

If you want to minimize ALL the windows the process that you select, wouldn't it be cleaner to hide the application instead of minimize? Say you have 6 windows open, that is 6 more items added to your dock while hide would achieve the same result of getting those windows out of your way but would leave your dock clear. For all windows, I would suggest hide, for a specific window, that would be the time to use minimize.

 

Hope I understood your needs correctly. If I did, I put together pretty much exactly what raguay suggested except not using minimize but hiding an apps windows instead. I muse be honest, I am no good with code of any kind so luckily this was only a couple of lines of a very googleable solution.

 

I would wait for raguay to be able to whip up something more sturdy but in the meantime this might be sufficient for you needs. Thank raguay for the suggestion and ted wise for the original workflow.

 

http://d.pr/f/qGLn

 

I changed the modifier keys around so you might not like them. Simply added one applescript to what was already there originally in the workflow by ted wise.

Link to comment

Now I have a workflow idea that would be cool along the same lines as what TingTingBen is looking for but a bit more complex and taking advantage of keywords.

 

Using a process script filter such as "Running" by Ted Wise, it would be awesome to select a process from the list and have it display all of that applications windows. Probably having the selected app passed to another script filter you are shown the titles of the app's windows and can either (by modifier) choose to hide, activate, or minimize that select window of the application instead of the entire application's windows being minimized-hidden-shown.

 

I think that's a bit more complex so I'll try but if I don't get anything up by the end of the weekend... it's probably not happening. Anyone else think this would be useful?

Link to comment
  • 1 month later...

Hi,

 

Sorry for answering so late. Thank you all very much for your help.

So I modified the Running workflow, adding an AppleScript to minimize window(s) of an app.

 

The script itself (for instance with Safari) works perfectly:

tell application "Safari"
	set miniaturized of every window to true
end tell

... but does not work once in the workflow:

on alfred_script(q)
	tell application q
		activate
		set miniaturized of every window to true
	end tell
end alfred_script

Any idea why? Is it because of the process/application difference?

Link to comment

Now I have a workflow idea that would be cool along the same lines as what TingTingBen is looking for but a bit more complex and taking advantage of keywords.

 

Using a process script filter such as "Running" by Ted Wise, it would be awesome to select a process from the list and have it display all of that applications windows. Probably having the selected app passed to another script filter you are shown the titles of the app's windows and can either (by modifier) choose to hide, activate, or minimize that select window of the application instead of the entire application's windows being minimized-hidden-shown.

 

I think that's a bit more complex so I'll try but if I don't get anything up by the end of the weekend... it's probably not happening. Anyone else think this would be useful?

 

I'll add it to my queue. If no one has written it before I get to it, then I'll have a try with it.

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