Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    522

Everything posted by deanishe

  1. Sometimes. Most of my own scripts are copied (or cobbled together from snippets) from forums/websites relating to the specific application.
  2. It's trivial to do with Automator. Save your workflow as an application (called "Quit All"), then you can run it from Alfred.
  3. It appears Alfred is still acting too fast for Adobe apps to keep up. @Andrew Perhaps it would be a good idea to give users text boxes to enter the delays in rather than having to keep altering the hard-coded maxima in Alfred? No matter how much you slow it down, Adobe appears to be able to go even slower…
  4. Could you not add additional entries to the List Filter that are the other way around (i.e. "53" is the title and "⎋ / Escape" is the subtitle)?
  5. Yes. Alfred remembers what you action for each query, and moves that result to the top. Of course, it doesn't work if you action several different items for the same query.
  6. I released the update yesterday. Grab it from the link above.
  7. If you action the result you want a couple of times, Alfred should remember it and then it will be top result for that query.
  8. No idea: you're not giving me anywhere near enough information to work with. Please follow the instructions in the Reporting Problems with Workflows sticky.
  9. No. Alfred’s search does not work that way. I believe a match must always start at the beginning of a “word”. I’m going to add hostname to my (new) Safari workflow. It’ll probably be an option you need to turn on. The workflow supports fuzzy search, so it will also pick up matches in the middle of words. Should be done this weekend.
  10. You could write a very simple workflow that lists only the immediate subdirectories.
  11. Absolute madness. I do agree with that, but bash has some really sharp edges, which turn things that should be pretty simple, like string manipulation, into a nightmare. Remember how many problems escaping caused in Alfred 2. Even some of the demo workflows had incorrect settings.
  12. Often very true. It’s just that when you come back to add some more features to your script, depending on what it is, you can run into the limits of bash/zsh very quickly. The Script we’re talking about here needs to call Perl — a full scripting language — to ensure valid output. I disagree with this notion, as we’re on the Alfred forum. A little bit of code can go a long way in a workflow. And I think workflows are an excellent way to start coding. But bash/zsh are a bad choice for them, as they just don’t support the features you need. Sure, if you want to write CLI scripts, zsh is a decent place to start (better than bash, imo). If you want to write dynamic webpages, then PHP and/or JS are reasonable choices. But if you go with workflows, I think you’re better served with Ruby or Python. This is a particularly nasty feature of shell scripting. It’s very, very easy to make mistakes due to the funky string handling and special characters. You think that way, and so do I, but an awful lot of people are in the “if the only tool you have is a hammer, everything looks like a nail” camp (I’m looking at you, people who write workflows in Node). In either case, learning Ruby or Python will get you a lot further before you run into any “wrong tool for the job” wall. I’d say it’s the other way around. Bash has weird syntax, cryptic shorthand, crappy typing and awful error handling. Better to learn a language with sensible typing and error handling first, so you’re aware of the lack of those things when you start playing with bash in earnest.
  13. If you don't want to set all your searches to UK, here's the correct URL: https://www.amazon.co.uk/gp/aw/s?k={query} You can't just make up a URL. You go to the website, perform a search, and then adjust the resulting URL.
  14. If you’re interested in learning to code, consider learning a real language like Ruby or Python instead. Shell languages like bash and zsh are pretty inscrutable, and are only well-suited for very simple tasks.
  15. @lutefish I'm afraid I'm not very familiar with this workflow, as I don't use Zotero (I think that's what it's called…). Don't worry about that: this whole workflow was beyond @smarg19's ability when he started it. Didn't stop him at all And as with Stephen, I'm happy to help with any Alfred or Python-related questions. I see you already forked the repo. What you should do it change the files in the source directory, which directly corresponds to the workflow's contents, and then use this script to symlink the source directory to your workflows directory (i.e. workflow-install.py -s source from the workflow root). You can also use this script to build your .alfredworkflow file (i.e. workflow-build.py -v source). As regards self-updating, change smargh/alfred_zotquery to lutefiasco/alfred_zotquery (i.e. your repo) and be sure to add the .alfredworkflow file to any release. Here are the relevant docs for the Alfred-Workflow library (which does the updating). Regarding updating Alfred-Workflow (the fixum thing): That can be a little involved, as it requires installing pip. Once you've done that, change to the source directory in Terminal or iTerm and run /usr/bin/python -m pip install --target . --upgrade Alfred-Workflow
  16. @jcwacky What does "overkill" mean? The workflow isn't huge, you don’t have to use the other features, and it's trivial to add a Script Filter that goes directly to the Lipsum feature. If the paragraphs are too short, I can add an option to specify their length (the underlying library defaults to 3 sentences, but that's configurable and I can easily expose that option to workflow users). Most importantly, the workflow is maintained and entirely self-contained, so it isn't going to stop working if an API changes, a server is inaccessible or if you're simply offline. As theoretically better as David's workflow may be, it’s essentially abandoned. The download link is dead, and David — quite understandably — hasn’t had much time for the Alfred community since he became a father (his last post was almost a year ago). If one of you would like to fork, fix and maintain the workflow, that'd be great. If not, then it's only a matter of time till it stops working again. Also, a good tip for anyone using curl in a workflow: Always add -L to curl calls, so it follows redirects. If David had done that, his workflow would still be working. (But I wouldn't recommend that as a fix.)
  17. Just put Stephen's name in the README as the original creator, and add your own name to the exiting copyrights in file headers, rather than replacing his. Don't bother commenting out old code: just delete it. Stephen's not maintaining his workflows any more, so I don't think he would object to your forking and continuing ZotQuery. Everything he did is preserved for posterity via git. FWIW, the workflow is configured to self update. You should change the settings to point to your repo, and attach the .alfredworkflow file to each release if you want that mechanism to work properly. Also, I strongly recommend updating the version of Alfred-Workflow bundled with the workflow, instead of using Fixum: Alfred will disable the workflow for new users if it recognises the old version.
  18. What do you mean exactly? Your iPhone/iPad history is already included if you have Safari syncing turned on.
  19. Why don't you try the workflow I posted just above instead?
  20. Thanks. That’s really interesting. I had no idea Hammerspoon could do that. I’ll have to look into that, as I currently use ControlPlane for that sort of thing, but I find it terribly clunky.
  21. I use the BookMacster app to sync bookmarks between browsers, but it's a bit buggy and I still don't really fully understand how to use it (the UI is extremely complicated). Out of interest, how do you handle switching between browsers? Do you just change the default browser so Alfred/the workflow opens URLs in the correct app, or is it some workflow magic?
  22. I use my bookmarks for pages I will visit regularly. Pinboard is for things I that I know I will probably want again at some point, but not regularly. Things like articles about SQL joins or interesting libraries, which I know I won’t remember. It also offers good integration with apps and other tools. I’ve had a Pinboard account for many years, so I don’t pay a subscription for it.
  23. Are you sure you don't still have a finger on ⌘ when Alfred "ignores" a letter? That's by far the most common cause when that happens. Again, I don't think it's related to the workflow. Alfred pops up its window, ready for input, and then loads the workflow. If you're sure you're letting go of ⌘, then I think it's most likely that you're trying to enter your query before Alfred's window has taken focus and is accepting input. You can test this by adding sleep 2 to the script. The workflow now takes 2 seconds longer to load, but Alfred doesn't take 2 seconds longer to be responsive. I think a workflow/environment variable would be a good fit for that. 10 minutes is perhaps a great choice for hardcore Pinboarders, but I only add a couple of bookmarks a week, so every few hours would be much more appropriate for me. FWIW, if you don't have a huge number of bookmarks, you could try combining this workflow with my fuzzy search helper. It'd take a bit of wrangling (you'd need to move the main Script Filter into an external script), but that would match "art" to "deviantart". But as noted above, it will be significantly slower than using Alfred's native search, which will become very noticeable if you have over, say, 2000 bookmarks.
  24. v0.4.1 fixes a bug with URL actions.
  25. What do you mean "trigger"? How are you executing the workflow? It sounds very much like you're trying to enter your query before Alfred is ready to accept it. If the first character is missing in Alfred's search box, that's between you and Alfred: no workflow has any influence over that. If you look more closely at the code, you'll see that the workflow does cache your bookmarks for 10 minutes. After that, it queries the Pinboard API to ask if your bookmarks have been updated since it last cached them. Only if they have will it download your bookmarks again. The "Fetching bookmarks…" text is the placeholder Alfred shows until the workflow returns results. No: Workflows don't work that way. The workflow script is run anew each time you use the workflow. Basically, this workflow is as fast as a workflow written in a scripting language can be. Short answer: No. Your best bet here is to ensure that your deviantart.com bookmark has the individual word "art" in its title or to tag it with "art" and do the same, mutatis mutandis, for your other bookmarks. Long answer: The workflow makes a fundamental trade-off between lightning fast search (using Alfred's search) and the odd delay while it updates, plus the limited flexibility of Alfred's search (i.e. not fuzzy). The delays could be removed and fuzzy search implemented, but at the cost of a ~25x reduction in search speed. Personally, I'd increase the between-checks time to an hour or more to reduce the frequency of API calls, but that's about the only dial there is to twist.
×
×
  • Create New...