Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    523

Everything posted by deanishe

  1. What are you hoping to do exactly? Show the search results in Alfred or enter a query in Alfred and automate the search in Safari?
  2. The code I posted earlier to run the workflow takes the screenshot with the screencapture command. I assume you'll want to change the options to the command to take the kind of screenshot you want (window, whole screen etc.). As I wrote in my first post, that code block goes in the Script box in a Script Filter in the workflow. There's a problem (or two) with my code, however. Because it names the screenshot .temporary-screenshot.png, it's (i) invisible in Finder (name starts with a period) and (ii) you can only add one screenshot per folder. This would work better (it adds 1, 2, 3 etc. to the filename): outfile="{query}/Screenshot.png" i=1 while [[ -f "$outfile" ]]; do outfile="{query}/Screenshot $i.png" (($i++)) done mv $HOME/.temporary-screenshot.png "$outfile" Anyway, this is going to take forever to explain in text, so I made the workflow for you. Use that instead, use it as a reference or keep it just in case you can't get your version to work. I made the keyword .screen (with a preceding period), so Alfred doesn't take screenshots every time you enter something that looks a bit like screen.
  3. Thanks for posting the code. Obviously, it's impossible to diagnose the error on line 5 without line 5… ‘~/Test 1’, ‘~/Test 2’, ‘~/Test 3’, Those aren't single quotes. It should be: '~/Test 1', '~/Test 2', '~/Test 3', If you're using TextEdit to edit code, stop now and get a proper code editor. TextEdit replaces quotes with "smart" quotes, which will break any source code. TextMate is very good and free. If you need to add valid non-ASCII values (i.e. in one of the folder paths), add this to the top of the script (like in the scripts in the tutorial I linked to earlier): # encoding: utf-8
  4. Try reload to tell Alfred to rebuild its list of installed applications. If the problem exists in other applications, too (duplicates in Finder's Open With menu; duplicates in Spotlight), then the problem is with your system and you need to rebuild your Spotlight and/or Launch Services databases.
  5. You put the script in the wrong directory. It goes in your workflow's root directory, alongside info.plist. If you've installed Alfred-Workflow and have a "workflow" directory, don't put anything in there. That's the Alfred-Workflow library's directory (the first workflow in from workflow import Workflow).
  6. Yes, but you'll need to do some coding. It appears you need: A Hotkey to trigger your workflow A Script Filter thatTells the system to take a screenshot and save it to a specific location Shows a list of pre-determined folders A script that accepts the path of the folder from the Script Filter and moves the screenshot to it. You can probably grab the screenshot with screencapture. With Alfred-Workflow, showing a list of folders is simple: import os from workflow import Workflow folders = [ '~/Documents/Stuff', '~/Desktop/More Stuff', '~/Dropbox/Screenshots', ] wf = Workflow() for path in folders: p = os.path.expanduser(path) wf.add_item(os.path.basename(path), path, arg=p, valid=True, type='file') wf.send_feedback() If you stick that in folders.py in your workflow, your Script Filter (Language = /bin/bash) might be: set -e screencapture -o $HOME/.temporary-screenshot.png /usr/bin/python folders.py And you'd connect that to a Run Script Action (also /bin/bash): mv $HOME/.temporary-screenshot.png "{query}"
  7. If they have file extensions, you should still be able to find them with File Filters. Just drag one of the files to the File Types box in the File Filter configuration.
  8. The delay is the workflow asking Reminders.app for its lists. Then it does indeed cache the lists for 10 seconds to make the workflow snappier to use (you don't want it talking to Reminders.app on every keypress). Currently, it's set up to cache the data for 10 seconds. You can change that in the code if 10 seconds is too long/short. In a more "serious" workflow, I'd retrieve the data from Reminders.app in a background process, so the workflow is always super snappy. If you want to do that, here's a tutorial.
  9. The root cause is that the Spotlight API does diacritic folding, the AddressBook API doesn't. To get diacritic folding with contacts, turn on: Alfred Preferences > Features > Contacts > Advanced > Use Spotlight metadata for searching contacts.
  10. I assume you're talking about Convert. It would be fairly easy to repurpose that workflow to behave the way you want (e.g. start showing common rates when only one currency is specified; search on currency name as well as 3-letter code). It doesn't currently work that way because it knows nothing about any of the units apart from currencies. If you pulled the other units out, however, it'd be fairly simple to do.
  11. I'd suggest using a proper XML library to generate the XML (Python has several built in). The workflow chokes on files with & in the path because it doesn't escape any of the XML values.
  12. There are quite a few moving parts in a workflow like that, so I built a very simple one that you could extend as needed. You might want to change it to also filter on account name as well as list name, for example. The corresponding docs are here. Download and install the workflow from here.
  13. How are you activating the scripts? If you're using Hotkeys, remember that if you've still got your fingers on modifier keys when you tell System Events to keystroke ..., it won't work as expected. That is to say, if you use, say, ⌘+E to run a script that calls keystroke "v", if you've still got your finger on ⌘, that will become ⌘+V, i.e. Paste.
  14. Sorry I didn't reply sooner. I read your post and checked out the issue, but forgot to reply. Essentially, that's a "feature" of the particular website's implementation. There's nothing Searchio! can do about it, I'm afraid.
  15. Yup. Adding cc/bcc and webmail support are next on the list. I'm currently stuck in the middle of a Searchio! rewrite, however. That has to come first because the rewrite is currently 10% working, and I really, really need that workflow…
  16. This isn't a useful bug report. That "gibberish" is the error message. You need to post that. Fundamentally, if you need help with something, you have to specify: The software/configuration that's throwing the error (i.e. the code and/or workflow configuration) The exact input The expected result The actual result (including all the output, even if it looks like gibberish) If someone reading your post can't replicate the problem you're having, the chances of it getting solved drop dramatically. The easier you make it for somebody to replicate the problem, the better your chances of getting help.
  17. Dunno. This might be the first Andrew has heard of the issue, but it doesn't seem to be specific to Alfred. Whenever this has happened, I've also had other issues with the system, and restarting the affected applications has no effect. As a result, I figure it's a bug in some OS X subsystem.
  18. To get performance with that amount of data, you can't be loading them into memory each run. You should probably be using an sqlite database. You seem to be re-implementing a lot of Alfred-Workflow, too.
  19. I'm afraid I don't know, then. That's the standard way of opening a URL in a specific application. I don't have the app to play with, so I don't know about any app-specific way.
  20. In your workflow, add a Hotkey and select OS X Clipboard contents for the Argument. Connect this to a Run Script action. Set Language to /bin/bash and put the following in the Script box: open -a "Keyi Video" "{query}" It's possible you might need open -a "可意视频" "{query}" instead.
  21. Those are all Python workflows. I haven't figured out why, but sometimes Python stops working in applications (I've had the issue with Alfred and Sublime Text). If other, non-Python workflows continue to work, I'd suggest this may be the problem you're having. The only fix I've found so far is rebooting.
  22. My favourite pip trick: When you're not sure which Python (or pyenv etc.) the pip command is pointing to, you can use /path/to/the/python -m pip --pip --options pip args
  23. You should have a look at the HoudahSpot dictionary in Script Editor and see what else you can do.
×
×
  • Create New...