Jump to content

Checking if an app is running before executing a branch of the workflow


Recommended Posts

Posted

Hi all,

 

Is there a simple way to check if an application is open before executing a part of a workflow?

 

I'm working on a workflow where at a certain point I have to introduce a delay. This is only necessary when the app is closed. However if the app is open then we don't need the delay.

 

Is there any way to do this natively in Alfred or do I have to incorporate this into my code somehow?

 

Thanks!

Posted

Hey this is close. I think I wasn't clear enough. Is there any way to check if the app window is open. (i.e the app could be open but have it's window closed).

 

I'd only want to run this branch if the window was open.

Posted

This won’t work for every app, but if you have a Run Script Action with Language set to /usr/bin/osascript (JavaScript) and code Application("Safari").windows().length > 0 (replace Safari with the app’s name), it should give the result you want.

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