Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    522

Everything posted by deanishe

  1. If I've understood you correctly, you want to pass two different values to two different actions at the same time. Alfred can't do that natively, so you can either bundle both your values together in arg and split them again afterwards or save one of the values to a temporary file and read it back from there.
  2. What I usually do is keep all the code in an external script that accepts command line options, e.g. --list or --config or --open-help or whatever. Then each keyword is linked to a "dumb" Run Script that calls the external script via bash with the appropriate command, e.g.: /usr/bin/python myscript.py --search "{query}" or /usr/bin/python myscript.py --config It's still bit clunky, but that's probably the best way to do it given the limits of Alfred's workflow execution model. It's also more explicit than performing some keyword-based magic in your script.
  3. Like he said, you probably need to check the settings. For whatever reason, the default date format in the workflow is "dd-mm-yy", not "dd.mm.yy" as in the description…
  4. Very nice. Have you thought about making a Script Filter, so that you get the result/error message live? Kinda like this:
  5. I meant with the GUI, not with Terminal. I know how to allow command-line apps. Can I get the Network Preference Pane to work that way?
  6. I have my own fork of it. Some of my workflow descriptions have < and > in them, which was breaking the HTML, so I fixed up the generation code.
  7. If you want to do that, you need to parse the info.plist in each installed workflow and grab the relevant modifiers and text. Shawn has done all the work of figuring out which code is which key in his Workflow Help Workflow, so if you dig through the source code of that, you'll be able to see which crazy number means which modifier keys.
  8. You can't just leave it at that, you sod. How????
  9. Alfred doesn't use your shell environment, which is what you see when you run locale or echo $LANG in Terminal. The workflow takes its default locale from your system settings with defaults read -g AppleLanguages (it grabs the first result). On my system, which has the preferred language set to "British English", I get: ( "en-GB", de, en, fr, "zh-Hans", "zh-Hant", ja, es, … … … ) Either change your Preferred languages in System Preferences under Language & Region so that "British English" is at the top, or append lang=en_GB to each of your formats, e.g: dateadd %x lang=en_GB will give you 19/06/2014. The Region you have set in Language & Region is ignored, as a lot of users have it set to where they live but have their system set to use English/British English. This results in unusable locales like en_DE or de_IT.
  10. I've updated the workflow so you can ⌘+↩ on the "No translations…" error to go to the website. I've also changed it to always show definitions regardless of language (previously, they had to match the destination language). Regarding examples: no, it's not possible to show them in Alfred, as the Glosbe API does not provide examples.
  11. I've never actually used it on a Mac, as I rarely do things in the Terminal that require sudo (I use Homebrew to install most software). Or does that also allow you to install stuff/change network settings without your password? That would be awesome!
  12. That was my first thought (keep the locate database updated), but it ultimately isn't really viable because it takes ages to update and you can't be running it every 15 minutes in any case, and you also want newly created files to show up in Alfred in a timely fashion (say a couple of minutes at the very outside). I think the current implementation is an acceptable hack solution: You can add a specific folder to be searched with find, and if it turns out you're rarely adding new ST project files to it (which is pretty much always the case for me), you can delete that folder from the configuration and just rely on the results from locate instead (which will have picked it up by this time). At any rate, I'm very glad I fixed the workflow, as I added another couple of ST project files to hidden directories yesterday. Sod grubbing around in the filesystem like an animal. The /etc/sudoers tip is an all-round amazing thing that everyone should know. I only found out about it a couple of weeks ago, and am gutted I didn't learn it sooner. To think of the amount of time I could have saved typing in my bloody passwords. I now use it for apt-get on all my Linux machines. It might be different on OS X, but on Linux in any case, you still have to prefix the command with sudo, you just don't get asked for your password.
  13. View and change your network location from Alfred. Installation Download the workflow from Packal or GitHub. Usage netloc [<query>] — Show list of network locations filtered by <query> if one is specified ↩ — Activate selected network location ⌘+↩ — Open Network Preferences ​Note: You will probably be asked to enter your password to change the network location. Licence This workflow is released under the MIT Licence.
  14. You can search Packal from within Alfred, and you will very soon be able to update workflows from within Alfred, too. (The current beta of the workflow is fully functional, but we're still trying to finalise the bundler, which it depends on.) What do you mean by "standardised"? Packal is a standardised way for sharing your workflows. If you mean "official", I think that's a red herring. Sublime Text and Vim do wonderfully well with their non-official plugin management systems. This forum seems to be the "official" way to distribute workflows, and Packal is far better suited to the task. "Official" only beats "un-official" if it's also equal in every other respect… I've been having a dig around the Launchbar extension docs, as the execution model is far more attractive than Alfred's extremely limited one, and the thing that struck me is the requirement for extensions to be signed. That's a fairly large hoop to jump through, imo, unless there's somewhere you can get free certificates suitable for signing code (startssl.com perhaps?). Self-signed certificates are understandably not acceptable, and there's no way I'm paying Apple $100/year to be able to write Launchbar extensions… Agree 100% with Alfred making its other UIs available to workflows.
  15. Significant update. See OP. No longer as simple (to write) as I'd hoped, but the workflow now supports finding files in hidden directories.
  16. So, I updated my ST projects workflow. locate turned out to be something of a dead-end (its database is so rarely updated), but I added it anyway, and also support for searching individual folders with find that mdfind otherwise wouldn't search. In addition, you can also specify globbing patterns that will exclude matching paths from the results. Note, the searching takes place in the background, so the workflow always remains responsive (in fact, it's faster than before), even while updating. It just might take a few seconds for new files to show up in the results.
  17. Is that the workflow I wrote? I had the same problem myself with my ~/.dotfiles folder. I tried a few things to get mdfind to return the contents of hidden directories, but it won't One alternative is to swap out the mdfind command for locate '*.sublime-project', but this is a lot slower and returns results you definitely don't want, such as .sublime-project files located within installed apps' bundles. My current workaround is to just keep the project files in another directory. It's no biggie, as I only ever open them via Alfred. Still, I'd like this to work, too, so I'll see what I can do.
  18. Yeah. Also try creating a Smart Folder that contains your Markdown files and see if that shows all the files.
  19. This one so much. Multi-level workflows are so common, and the current "hacks" of using special delimiters or calling back into Alfred via AppleScript look ugly and amateurish and complicate the coding of workflows significantly. Proper support for multiple levels (so you can drill-down and back out like on iOS apps) would be a massive help.
  20. Sublime Text Projects Filter and open your Sublime Text project files. It can be tricky getting .sublime-project files to work because Sublime Text doesn’t open them properly; only the command-line program does. This workflow solves that problem. The workflow also supports a VS Code (or VS Codium) mode (i.e. it works with .code-workspace files instead). Installation Download the Sublime-Text-Projects-X.Y.Z.alfredworkflow and double-click to install. Usage There is one keyword, .st, which works as follows: .st [<query>] — List/filter your .sublime-project files files ↩ — Open result in Sublime Text⌘+↩ — Reveal file in Finder .st rescan — Reload cached list of projects .st config — Show the current settings Hotkeys There are two Hotkeys (coloured red) for opening selected files in Sublime Text. One is for Finder/Path Finder, and the other for all other apps. Assign the same Hotkey to both. The Finder/Path Finder Hotkey doesn’t use “Selection in macOS”, and opens the target of the frontmost window if nothing is selected. Universal Actions There are “Open in Sublime Text” actions for files, text and URLs. Files are opened, and text is opened in a new document. Multiple URLs are treated like text, but if you pass a single URL to the Universal Action, the workflow will create a new document with the content fetched from the URL. External Triggers There are External Triggers you can call to create a new document with the given text, open the given file, or retrieve the given URL and create a new document with its contents. See the docs on GitHub or select “View Help File” from the workflow config view for more info.
  21. Hmm. If you're only using .md for markdown files, I don't know. Sometimes, resetting the file filter can help.
  22. Hmm. What about the file extensions? .md is mapped to net.multimarkdown.text on my system, for example.
  23. Indeed, but the VM it's running on isn't as interesting as what libraries they may have added to it, hence why I mention node, not V8.
  24. That's why I hate it. The syntax is incomprehensible. I wonder how fast JavaScript will run as a scripting language. The scripting bridge is hideously slow. Fingers crossed they've done something about that, but I'd be surprised if JS runs noticeably faster than AS, regardless of how fast JS VMs have become. Do you know anything about Apple's JS runtime? I'm guessing it won't have the kind of IO features etc. that node does.
  25. you can search Packal via CLI if you pull the Python script out of my workflow. Afraid the output is XML, though
×
×
  • Create New...