Jump to content

justmytwospence

Member
  • Content Count

    19
  • Joined

  • Last visited

  1. I'm sure many users would appreciate being able to customize the up/down navigation keys, eg to j/k.
  2. Thanks for looking into it Tyler, but no change for me.
  3. Great workflow! I do have about a 2 second delay, however. Also, could you add a "center" keyword?
  4. I third the deletion issue. Even uninstalling and reinstalling did not get rid of them.
  5. Ahh that was it, Carlos. Moved it to my Public folder and we are good to go. Thanks!
  6. That doesn't seem to work, I just get little broken image icon.
  7. Sorry sdaitzman, the download is back up. How do I get my picture to display in the post though :/ ?
  8. wordlist.csv is indeed in the workflow folder. Its actually up and running now - but I'm still not sure the way I am passing parameters to the python script is the best way. Right now, the workflow runs this command using bash: ./randomGen.py {query} I can pass it two arguments from Alfred this way, which are interpreted as argv[1] and argv[2] by the python sys module. I am jerry-rigging default parameters using try/except, which is functional but seems clunky. Additionally, it means that I can't give the second Alfred argument unless I also give the first (otherwise it will be argv[1] instead of argv[2]). #!/usr/bin/env python import urllib2 import sys try: dictionary = str(sys.argv[2]).lower() + '.txt' except: dictionary = 'british.txt' with open(dictionary, 'r') as handle: wordlist = handle.readlines() for x in range(0,len(wordlist)): wordlist[x] = wordlist[x].strip() def generate_password(length = 4): maximum = len(wordlist) random_request = "http://www.random.org/integers/?num=" + str(length + 1) + "&min=0&max=" + str(maximum) + "&col=1&base=10&format=plain&rnd=new" random_page = urllib2.urlopen(random_request) random_integers = random_page.readlines() for x in range(0, length): random_integers[x] = int(random_integers[x].rstrip('\n')) i = 0 password = [] while i < length: new_word = wordlist[random_integers[i]] password.append(new_word) i = i + 1 password.append(random_integers[i][:2]) password = '-'.join(password) return(password) try: query = int(sys.argv[1]) print(generate_password(query)) except: print(generate_password()) How do y'all who use python with Alfred deal with parameters?
  9. I've figured out a way to make it work with a try/except. Can anyone confirm that it is the simplest/best way? #!/usr/bin/env python import urllib2 import sys f = open('wordlist.csv', 'r') wordlist = f.readlines() for x in range(0,len(wordlist)): wordlist[x] = wordlist[x].rstrip(',\n') def generate_password(length = 4): maximum = len(wordlist) random_request = "http://www.random.org/integers/?num=" + str(length + 1) + "&min=0&max=" + str(maximum) + "&col=1&base=10&format=plain&rnd=new" random_page = urllib2.urlopen(random_request) random_integers = random_page.readlines() for x in range(0, length): random_integers[x] = int(random_integers[x].rstrip('\n')) i = 0 password = [] while i < length: new_word = wordlist[random_integers[i]] password.append(new_word) i = i + 1 password.append(random_integers[i][:2]) password = '-'.join(password) return(password) try: query = int(sys.argv[1]) print(generate_password(query)) except: print(generate_password())
  10. Hi all, I'm trying to get my first workflow ever up and running. Its a modification of Jeremy Pippin's password generator, but this one has a larger dictionary, random word selection from random.org's API, and a parameter for the number of words you want. Right now nothing happens when I run it using Alfred with no {query}. I'm sure its something simple - I'm not sure that I'm checking for the existence of {query} properly. The python script is below. I have the workflow set up to copy the output to the clipboard and paste into the frontmost app. "zoe", "zomba", "zone", "zoo", "zoom", "zorn", "zurich", ] import urllib2 def generate_password(length = 5): maximum = len(wordList) i = 0 password = [] while i < length: random_request = "http://www.random.org/integers/?num=1&min=0&max=" + str(maximum) + "&col=1&base=10&format=plain&rnd=new" random_page = urllib2.urlopen(random_request) random_integer = int(random_page.read().rstrip('\n')) new_word = wordList[random_integer] password.append(new_word) i = i + 1 number_request = "http://www.random.org/integers/?num=1&min=0&max=99&col=1&base=10&format=plain&rnd=new" number_page = urllib2.urlopen(number_request) number_integer = number_page.read().rstrip('\n') password.append(number_integer) password = '-'.join(password) return(password) query = {query} if 'query' in globals(): print(generate_password(query)) else: print(generate_password()) Thanks for helpin' out a noobie!
  11. Nice little theme that I really like. I use it with blur set to around 3 using the transparency workflow. Very zen. Download here: https://www.dropbox.com/sh/wz38e98smja5n7t/dC1-XJrVsp/Nothing%20More%20Nothing%20Less/Nothing%20More%20Nothing%20Less.alfredappearance
  12. Nice workflow! Very useful. Could you add to the dictionary of words though? This scheme is only as secure as the number of potential words, and right now it only has a few hundred. Would be great to see a few thousand instead.
  13. Okay zmjones - this one really fixed it for me. Download OnyX if you don't already have it installed. Go to Parameters -> Finder and select "restore defaults". woohoo.
  14. Hmm actually that worked for me on my desktop but not my laptop. Are we allowed to keep discussing here even after this is closed Andrew/Vero?
  15. I found a fix, maybe it will help you zmjones, maybe not. Try moving your Finder plist, something must be messed up in there. See here: http://www.mac-forums.com/forums/os-x-operating-system/212652-cant-eject-dmg-file-error-emptying-trash.html
×
×
  • Create New...