Jump to content

How to "un-minimize" (aka restore, un- miniaturize) an app's windows with Alfred?


Recommended Posts

I'm trying to make a universal hotkey workflow that will "un-minimize" an app's windows-  the ones with those pesky diamonds next to them e.g.

 

image.png.8bdc45295cf855c31b47446c6016ae8b.png

 

No matter what I've tried, it's failing to work. I spent a good 3 hrs on this today and basically got nowhere. Here's a snippet of code that (mostly) works when run from Script Editor, but it fails miserably when put inside an Alfred osascript of NSAppleScript object:

 

tell application (path to frontmost application as text)

  try

    set miniaturized of windows to false

  end try

  try

    set collapsed of windows to false

  end try

  try

    set minimized of windows to false

  end try

end tell

 

This works (again, in Script Editor only...) with Safari, Chrome, Messages.app, Apple Remote Desktop, Calendar, Contacts, and others. It does NOT work for Finder.app, Sublime Text (and probably a bunch of others).

 

Anyone know of a way to do this? Even if it only works 90% of the time? Right now I am stuck at 0.

Edited by luckman212
Link to post
  • luckman212 changed the title to How to "un-minimize" (aka restore, un- miniaturize) an app's windows with Alfred?
On 1/28/2021 at 10:14 PM, luckman212 said:

but it fails miserably when put inside an Alfred osascript of NSAppleScript object


First you’ll need to figure out why. While I understand the frustration, “fails miserably” gives us no information. Is there an error message?

 

If your script acts on the front most app and it works in Script Editor but not Alfred, they may be seeing different front most apps. Start by changing your script to just output the name or path to the front most app

and try it again in both places. See if there’s a difference. That will bring you closer to the root of the problem.

Link to post

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