luckman212 Posted January 28, 2021 Share Posted January 28, 2021 (edited) 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. 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 January 28, 2021 by luckman212 Link to comment
vitor Posted February 1, 2021 Share Posted February 1, 2021 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 comment
luckman212 Posted February 5, 2021 Author Share Posted February 5, 2021 Thanks Vitor. I'll try to present some better info. For now, I'm experimenting with accomplishing this using Hammerspoon, seems that might be more efficient. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now