dino_enthusiast Posted February 27, 2018 Share Posted February 27, 2018 Hey All! Long time listener, first time caller. QUESTIONS Is there a way to set an Alfred variable from within a Run Script (bin/bash) command? For reference I'm calling a python script (i.e., python my_script "{query}") If not, how can I store the output of the Python script when it is a complex data type like a dictionary? CONTEXT I'm trying to write a workflow that utilizes an API, grabs some values, and then opens a URL. The user will enter an ID, the python Run Script will retrieve information about this via the API call, and then using the returned data I would like to open a web URL. Currently the python script is creating a dictionary of useful data and storing like so: useful_dict_info = {"key1" : "value1", "key2": "value2"} I think return from the Run Script by using print: # some code to create useful_dict_info print useful_dict_info What I would like to do is either store key1 and key2 as Alfred workflow variables from within the script OR parse the output from Run Script and store them as Alfred workflow variables. Thoughts? P.S. I'm a huge fan of Alfred and thanks for all the work you've put into it so far. It saves me minutes, if not hours, each day and I keep adding more and more workflows! Link to comment
deanishe Posted February 27, 2018 Share Posted February 27, 2018 Hi Dino, This question belongs in the Workflow Help & Questions forum, where you will find the answer you seek stickied: If you have any further questions about workflow variables, please ask in that thread or forum. xanimus 1 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