Tom6 Posted April 13, 2020 Share Posted April 13, 2020 Hi, I have a cron job using an external trigger to open Alfred's search box. If the alfred search box is already open, it closes it and open a new one instead. I'd like to "skip" a specific cron execution if Alfred's search box is already opened Can I know if it's open programmatically / or through a component in the workflow? Thanks Link to comment
deanishe Posted April 13, 2020 Share Posted April 13, 2020 You can use AppleScript to ask System Events if Alfred has any windows: tell application "System Events" repeat with _process in (processes whose name is "Alfred") return (count of windows of _process) end repeat return 0 end tell If it doesn't return 0, Alfred's window is open. Link to comment
Tom6 Posted April 14, 2020 Author Share Posted April 14, 2020 12 hours ago, deanishe said: You can use AppleScript to ask System Events if Alfred has any windows: tell application "System Events" repeat with _process in (processes whose name is "Alfred") return (count of windows of _process) end repeat return 0 end tell If it doesn't return 0, Alfred's window is open. works - thank you 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