Jump to content

super_goat

Member
  • Posts

    3
  • Joined

  • Last visited

  • Days Won

    1

super_goat last won the day on February 11 2017

super_goat had the most liked content!

super_goat's Achievements

Helping Hand

Helping Hand (3/5)

1

Reputation

  1. I think its complaining about the an index out of range. You need to be sure your "arglist" list really has three entries when you split it. I've tidied up your main function (note, haven't run this): def main(wf): try: if not len(wf.args): raise Exception arglist = wf.args[0].split(',') randport1 = random.randint(5000,7000) randport2 = random.randint(5000,7000) port = arglist[0] srv1 = arglist[1] srv2 = arglist[2] query = "-A -t -L 9800:localhost:{0} -L {1}:localhost:{2} user@{3} ssh -L {4}:localhost:9800 -L {5}:localhost:80 user@{6}".format(randport1,port,randport2,srv1,randport1,randport2,srv2) wf.add_item( title = "Jump from %s to %s" % (srv1,srv2), arg = query, valid = True, icon = ICON_WEB) except: wf.add_item(title = "Error", subtitle = "Malformed Input!", icon = ICON_ERROR) wf.send_feedback()
  2. Hi Blake, I quickly put together something which may be what your looking for: https://dl.dropboxusercontent.com/u/45099771/CIR-Example.alfredworkflow Use "cir" with a keyword to perform a search. It will copy the result to your clipboard and display a notification. I used the https://github.com/mcs07/CIRpy module linked above. If you right click the addon > show in finder, you will see the source. Modify script.py to output whatever you want (see the print statement). You may want to change the desired output representation (again, see the github module documentation). I'm sure you can figure the rest out
  3. Hi All, I was wondering if someone could help me with the logic of creating menus and sub-menus using Alfred-Workflow (http://www.deanishe.net/alfred-workflow/index.html). So far i have a Script Filter which presents a list of artists. When you choose an artist i'd like a list of categories to show, then a list of albums etc... My current project logic centers around calling my python script with arguments to generate the list items, i.e.: python script.py --artist "{query}"... etc. I've looked through the alfred-workflow documentation and there doesn't seem to be any inbuilt way to do this, without a bit of a hack. Thanks!
×
×
  • Create New...