Jump to content

Cybrosis

Member
  • Content Count

    5
  • Joined

  • Last visited

  1. 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.
  2. 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
  3. 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:
  4. 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" : "" } } } } }
  5. 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...