Jump to content

Continue execution after finishing terminal command?


Recommended Posts

I'm building a workflow that allows me to quickly edit any text on mac (in selection) and edit it in a nvim buffer. But only when I quit the nvim application, it should continue to run the workflow

image.thumb.png.36773c9f656c5f75f463c975054733de.png.

 

on the image, zou can see the workflow. right now the workflow will open the terminal, enter the command but immediatly start with the next thing

 

I could write a seperate script that for example waits for write actions on the specified file and then go on from there but I would prefer a simple alfred style solution. Is there any way to achieve the desired behaviour?

Link to comment

Welcome @Josef VI.,

 

The solution is to invert the problem. It’s Neovim/Terminal that must tell Alfred when the job is done.


Break that connection before the last Automation Task. Connect instead an External Trigger. Then, in you Terminal command, do something like:

 

nvim /path/to/file
osascript -e 'tell application id "com.runningwithcrayons.Alfred" to run trigger "TRIGGER_NAME_HERE" in workflow "WORKFLOW_BUNDLE_ID_HERE"

 

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