Jump to content

Cybrosis

Member
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Cybrosis

  1. Hey all! I'm trying to condense a very messy workflow with a whole ton of individual keywords that do specific, but similar things. What I would like to do is create keyword dynamically based off of my variables, which might look like this: j = jump w = walk t = talk I would have keywords for each of the variable names, that correspond to their values, so if i did "j tom" i would make tom jump, if i did "w tom" i would make tom walk, etc. Then if I wanted to add more actions in the future I could just add more variables. As it stands, I have about 50 of these that are all represented by individual keyword->actions in the workflow and it's getting unmanageable. Thanks!!
  2. Is there a way to integrate that into the workflow itself? I guess some sort of "set config" option that just opens the config file in the default text editor? I would rather not convert to a string; the option to have the options in a separate file on disk seems much more elegant.
  3. If I just send the output to large text in Alfred, it does display it (sort of) correctly. It removes some quotes but not all, and alphabetizes the list, which I feel is odd. https://www.dropbox.com/s/hzpx9qw68xas76i/Screenshot 2019-02-05 11.49.44.png?dl=0
  4. A bit more info. I've tried various methods to read this info into python. Even trying to print the variable gives me an error: import os print("imported var foo is a " + str(type(os.environ['foo']))) # this totally works print("imported var tableDict is a " + str(type(os.environ['tableDict']))) # this totally doesn't Error:
  5. A little more info. Here's the workflow JSON I'm using in the workflow. I tested the "foo" variable, and I can read it just fine. It's the tableDict variable that doesn't want to read into python: { "alfredworkflow" : { "arg" : "{query}", "variables" : { "foo" : "bar", "tableDict" : { "rack" : { "title_field" : "sys_class_name", "primary_search_field" : "name", "prefix" : "", "table" : "cmdb_ci_rack", "instance" : "datacenter", "subtitle_field" : "dv_location" }, "ci" : { "title_field" : "sys_class_name", "primary_search_field" : "name", "prefix" : "", "table" : "cmdb_ci", "instance" : "datacenter", "subtitle_field" : "" } } } } }
  6. Hey all! I'm making great progress on the workflow i'm working on, but I have hit a roadblock trying to move a large dictionary of settings out of a python script into...somewhere else. I need to be able to add to and change this data, and it really clutters the script it's running in, so I would love to try to move it into a JSON object in the workflow itself and then import it as a dictionary into the script. I'm running into an error when I try to read the os.environ variable into python. Has anyone done anything like this, or does anyone know a better way to store a bbunch of data for my scripts to read? Thanks! Chris
×
×
  • Create New...