Jump to content

How can I execute an external workflow with a passed argument without Alfred displaying the search window?


Recommended Posts

What I would like to achieve:


I want to run workflow (NightShift) with "night 25" passed to it from another workflow so that I will have 25% of night shift levels without typing "night 25" on alfred search bar window.

 

What I did:

 

I set inbound configuration in the NightShift's script filter with 25 as argument:

 image.thumb.jpeg.540e422e3f60d30f1084b925861bed12.jpeg

 

 

I set Call External in another workflow:

 

image.thumb.jpeg.f34d61d57f5e5d859aa16db6422810e8.jpeg

 

 

However, it just doesn’t pass itself but rather shows in alfred search bar window:

image.thumb.jpeg.e4e8e8e12c64d80406f98f0bfa03e2aa.jpeg

 

Any idea how I can avoid alfred displaying the search bar window and just pass "night 25"?

 

 

Edited by selfmade69
correction
Link to comment
  • selfmade69 changed the title to How can I execute an external workflow with a passed argument without Alfred displaying the search window?

It’s impossible to say exactly what you need to change without knowing which workflow you’re using (do you have a link?), but you need to connect externally to the Run Script, not the Script Filter. The Script Filter is what shows the options and you’re connecting to that, when you want to connect to what makes the changes. Probably; again, only looking at it can we say for sure.

Link to comment
29 minutes ago, vitor said:

It’s impossible to say exactly what you need to change without knowing which workflow you’re using (do you have a link?), but you need to connect externally to the Run Script, not the Script Filter. The Script Filter is what shows the options and you’re connecting to that, when you want to connect to what makes the changes. Probably; again, only looking at it can we say for sure.

 

I am about this workflow https://www.packal.org/workflow/nightshift

 

However I think the main thing is that I want to pass the command "night 25" from another workflow on it so that Nightshift workflow will do whats necessary.

Edited by selfmade69
Link to comment
3 minutes ago, selfmade69 said:

I want to pass the argument from another workflow on it with "night 25"

 

That would still invoke the Script Filter, which you’re trying to avoid.


Took a quick look at the code and it seems the comment above holds. Essentially you set it up correctly but on the wrong object. Set up the Inbound Configuration (or connect an External Trigger) on the Run Script instead.

Link to comment
14 hours ago, vitor said:

 

That would still invoke the Script Filter, which you’re trying to avoid.


Took a quick look at the code and it seems the comment above holds. Essentially you set it up correctly but on the wrong object. Set up the Inbound Configuration (or connect an External Trigger) on the Run Script instead.

 

Not sure why but it worked!

 

I set Inbound Config on the bash Run Script which is:

image.thumb.jpeg.3d1d54145af3ca6a202a16551511bb6d.jpeg

 

I also had to disconnect it from the trigger as it got other commands running as the same, I then made a copy of it and connect it to the Script filter.

 

image.jpeg.da1d7fa995145caf7a98e39df6f41829.jpeg

 

Could you please explain how come the Call External still works when the Run Script isn't even connected to the script filter, where the code actually is:

 

image.thumb.jpeg.9c234435d113b558971174c7af28f622.jpeg

 

Edited by selfmade69
details
Link to comment
1 hour ago, selfmade69 said:

I also had to disconnect it from the trigger

 

You don’t have to do that.

 

1 hour ago, selfmade69 said:

Could you please explain how come the Call External still works when the Run Script isn't even connected to the script filter

 

The Script Filter isn’t running code to change the Night Shift value, it’s only there to present an interface for you to insert a value. That value is then passed to the Run Script, which is making the change.

Link to comment
On 6/17/2023 at 3:56 PM, vitor said:

 

You don’t have to do that.

 

 

The Script Filter isn’t running code to change the Night Shift value, it’s only there to present an interface for you to insert a value. That value is then passed to the Run Script, which is making the change.

 

Welp! It boggles my mind how come this tiny part of code could tell night mode to send the command successfully:

 

./nshift "25"


 

Edited by selfmade69
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...