Jump to content

Alex M

Member
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Alex M

  1. That's a great point actually. Just give me the option to turn on actual auto-update (maybe with an easy way to check release notes in case I'm curious) and I'm happy.
  2. There should really be an Alfred command for updating Alfred. Like if the search bar shows "There's an Alfred update available", I feel like I should be able to type "update" and have it just do it instead of requiring me to open preferences and do it through there.
  3. Thanks for all of your help @deanishe, definitely appreciated. Here's the pretty much completed product in case anyone else finds it useful: alfred-browser-choice
  4. I ended up doing a lot more work than I planned on this, but I'm pretty happy with what I came up with. I started with @deanishe's workflow and then edited the python script to get a list of URL handlers from the OS instead of requiring them to be hard-coded. This does slow down the workflow by about 500 ms which isn't ideal, but it gets the job done. I've also discovered Alfred-Workflow and the built in support for caching so I'm going to try that later in order to speed things up a bit. It'd be great if there was a way to pull URL handlers directly from Alfred/Spotlight, but all I've been able to find so far is calling 'lsregister -dump' which is where most of the speed hit comes from. If anyone has any suggestions on how to speed that bit up I'd greatly appreciate it. In the meantime, here's the updated code I used for the workflow: """Open a URL in different browsers""" from __future__ import print_function, absolute_import from collections import namedtuple import json import sys import os import re rexps = [ re.compile('^\s*(bundle)\s*id:\s*(\d*)'), re.compile('^\s*(path):\s*(.*)'), re.compile('^\s*(name):\s*(.*)'), re.compile('^\s*(bindings):\s*(.*)') ] def log(s, *args): """Simple STDERR logger.""" if args: s = s % args print(s, file=sys.stderr) def gethandlers(): handlers = {} bundle = "" dump = os.popen("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump") for line in dump.readlines(): for rexp in rexps: m = rexp.match(line) if not m: continue key = m.group(1) value = m.group(2) if key == "bundle": if bundle != value: bundle = value name = "" path = "" if key == "name" and not name: name = value if key == "path" and not path: path = value if key == "bindings" and 'http:' in value.split(","): handlers[name] = path dump.close() handlers.pop('nwjs', None) handlers.pop('VLC media player', None) return handlers def main(): """Run Script Filter.""" url = ("http" + sys.argv[1]).decode('utf-8') log('url=%r', url) items = [] browsers = gethandlers() for b in sorted(browsers): items.append(dict( title='Open in ' + b, subtitle=browsers[b], arg=url, icon=dict( path=browsers[b], type='fileicon', ), valid=True, variables=dict( browser=browsers[b], url=url, ), )) json.dump(dict(items=items), sys.stdout) if __name__ == '__main__': main()
  5. Thanks to everyone for the suggestions! I'm going to try an updated workflow this afternoon and I'll let you know how it works out. Thanks!
  6. I actually used to use Choosy when I used to do this a lot more, but it's infrequent enough these days that the extra annoyance of using a separate tool outweighs the benefit. What I'd really love would be a way to register a URL as a "filetype" so that I can get the usual extra menu. i.e. if I type <space>filename.txt<tab> (assuming the file exists obviously), one of the options is "Open with...". What I really want is a way to have that same sort of menu for a URL.
  7. I've gotten kind of spoiled with the extended actions for some searches (e.g. App name > Tab > Open in Finder), so every time I paste a URL I kind of expect to be able to hit tab and choose which browser to use to open it. But I can't. Is there any built-in way to do this? I do use the clipboard integration as well so it'd be great if I can do it directly from the history view as well but that's not required. I looked into creating a workflow with the open URL action, but that doesn't seem to work with providing a full URL and it requires me to set to browser in the workflow which kind of defeats the purpose.
  8. Sorry, I totally missed this reply. Just tried the updated version with the frosty teal theme updated and I can confirm it's working fine now. Thanks!
  9. I was about to complain about performance having gotten nearly unusable over the last months on my 2015 MacBook (12", USB-C, not a powerhouse I know ), but I saw a different thread that mentioned changing your theme and that seems to have done the trick. What's strange is that performance is ONLY terrible with Frosty Teal. All of the other default themes (Alfred, Alfred macOS, Alfred Classic, Notepad and the dark variants) all work perfectly fine even though AFAICT all of them except for Classic still use transparency. Is there something "special" with Frosty Teal that could be causing things to be so unbearably slow? (and can it be fixed because I really do kind of like that theme)
  10. I just checked, and I don't see the indexing bar in Spotlight. And, as I said, the odd thing is that Spotlight seems to be unaffected. It can find apps with no problem, while in Alfred I have to try 3-4 times before it'll show up.
  11. So using "reload" seems to only make it "forget" the ones that I've gotten it to remember. I used Alfred to launch Chrome earlier, and when I tried it again after doing a "reload" I had to do the retype it 3-4 times thing to get it to show up again.
  12. I've been using Alfred 3 with the Sierra beta for a few weeks now with no problems. 2 days ago, I decided to do a clean install of Sierra on my MacBook and Alfred was one of the first things to get reinstalled. Since then, however, getting app names to come up has been REALLY slow. If I start typing the name of an app, all I'll get are the default Search Google/Amazon/Wikipedia results. If I try it again, the same thing happens. Usually after the 3rd or 4th try, it'll finally show the application as expected and I'll be able to launch it. Once it finds it once, it appears to be fine until the next time I restart the computer at which point it'll "forget" all over again. What's really strange is that using Spotlight, app names come up immediately. Since, to the best of by knowledge, Alfred uses the exact same data source as Spotlight, I really don't know what could be causing this. Any help would be appreciated.
×
×
  • Create New...