Jump to content

Getting variables out of python script


Recommended Posts

 

The above thread seems to indicate that an empty {query} will always be sent to the external script. However I'm trying to use this timer script https://github.com/dbader/alfred-countdown-timer/blob/master/Timer/timer.py and I think the code says that if I pass in an empty query it should display a notification telling me how to use this script. However in testing I found that main() doesn't even run when the query is empty. Am I misunderstanding something either about this script or how alfred works? Thanks!

Link to comment
On 5/20/2019 at 8:21 PM, ckueda said:

However in testing I found that main() doesn't even run when the query is empty

 

The workflow is set up so that you must enter a query before it will run the script. And the script itself won't work without any input (it requires at least one argument).

 

If you're trying to figure out how a workflow works, you can't just look at the workflow in Alfred Preferences or the source code. You need to consider both.

Link to comment

Thanks for the reply! I guess the first step would be to edit the workflow so that it doesn't need the query? Currently it looks like it's set so the argument is optional which I took to mean that it doesn't need a query? See attached screenshot. Or is it in the Run Script action?

Screen Shot 2019-05-21 at 2.03.36 PM.png

Link to comment
3 minutes ago, ckueda said:

Currently it looks like it's set so the argument is optional which I took to mean that it doesn't need a query?

 

Yup, you're right. I was wrong. Sorry, That notwithstanding, as you say, the script won't run without at least one argument.

 

3 minutes ago, ckueda said:

I guess the first step would be to edit the workflow so that it doesn't need the query?

 

I don't know. What are you trying to do?

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