Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    522

Everything posted by deanishe

  1. @td. As a rule, pictures aren't much help with trying to diagnose and fix problems. At a minimum, please also include any output in Alfred's debugger.
  2. Ah, right, thanks. It's in one of the libraries. That explains why I couldn't find it in the code. I guess it also works more or less the same as the "solution" I suggested. Good to know my idea wasn't that daft, as someone else has also done something similar. (When I wrote a workflow that does something similar, I ensured that only one downloader was running, so I didn't need such a smart queue.)
  3. That's interesting. Could you point me to the bit of code that does that (as I said, JS isn't really my strong suit)?
  4. Not easily, no. If you're using a keyword, then the active application is Alfred (as you're entering your query into it), which isn't where you want to get your selection from. You can work around it in a workflow by attaching your keyword to a Run Script action that simulates a ⌘C keypress and then uses pbpaste to grab the contents of the pasteboard. That doesn't work quite a smoothly as using Alfred's built-in feature, however. Your best bet is therefore to use a Hotkey.
  5. Are you guys sure you aren't accidentally copying an extra space or newline at the end of the API key?
  6. Oh shit, you fork the downloader, don't you. Yeah, 200 would be a really bad idea. Perhaps you could write a file to a "queue" directory for each URL to download, then have the forked downloader process (then delete) those files? Ideally also ensure that only one downloader is running at a time. I mean, it's quite likely the workflow is already making multiple, redundant requests for the same file, which is not super polite. (Correct me if I'm wrong: I'm no JS guru.)
  7. Add "amount=200" to the search URL. https://openclipart.org/developers
  8. In any case, you're not using the app cache in your workflow, so you can rip all that stuff out.
  9. The script is working properly. Try resetting the workflow cache with the query "workflow:delcache"
  10. Looks like the process is hanging. Open the workflow directory in Terminal (or iTerm) and run /usr/bin/python update_apps.py See what the app update script does.
  11. Dude, pictures are no help (particularly when they say the exact same thing as your post). I refer you again to the "reporting problems" thread both Vítor and I linked to. Post the log file. (Enter workflow:openlog as your query to see it.)
  12. It's an extremely simple format, providing you're using a language with JSON support. If you're not, you aren't writing Alfred JSON, you're writing a JSON library, which isn't a simple thing to do.
  13. Anyway, I'm moving this thread to the Workflow Help & Questions forum. There's no reason to think there's any problem with Alfred.
  14. But the workflow never calls the external trigger. That's an implementation detail, not relevant to the general principle. Instead of 18 List Filters, use a single Script Filter that turns the CSV file into Alfred's JSON format. Or better yet, generate JSON files instead of CSV to begin with and just use cat "$1" in your Script Filter. Yes. Use a proper programming language instead of esoteric and hard-to-understand command-line utilities. It's almost impossible to generate JSON properly from a shell. Just use a language that has a proper library for it.
  15. I've built a simple workflow. There are start and stop keywords to, well, start and stop the script. The actual script, ticker.py, is inside the workflow folder. Right-click the workflow in Alfred Preferences and choose "Open in Finder" to see it. By default, the script calls the workflow's notify External Trigger every 300 seconds (5 minutes). I've connected that to a Play Sound action, but you can connect it to any kind of action (or multiple actions). You can change the interval by adjusting the INTERVAL setting in the workflow's configuration sheet by clicking the [?] icon. The value is in seconds.
  16. It's very simple as far as scripts go. A few lines. I'll happily write it for you, but you'll have to tell me what you're actually trying to do: the workflow as you've described it doesn't actually do anything. It just starts then stops.
  17. It sounds like Alfred considers those to be two separate workflow processes. The way I'd do it is with a script that loops. It would delete a "stop" file on start up, then check every second to see if it exists. If it does, the script exits (possibly deleting the "stop" file). Your stop command would create the "stop" file. You could also write the looping script's PID to a file, then read it and kill the process with your stop command.
  18. It's gratifying to see that you've finally remembered to post your workflow instead of just a recording of it. OTOH, this workflow is disturbingly similar your last "mindmaps" workflow and is broken in exactly the same way, which I showed you precisely how to fix. My guess is that the problem is related to the issue you had with the previous workflow: you simply have far too many elements being run simultaneously. The entire design is bonkers. You have OneUpdater connected to a trigger that never fires. You have an empty (i.e. does nothing) Args & Vars after every Filter. You have 18 identical Open URL actions instead of one. The last time you posted a version of this workflow, I showed you exactly how to build it using one List Filter and one Script Filter. Why have you built it like this when you've been shown how to do it properly and you already know that trying to run so many actions at the same time causes issues? Why didn't you build a single List Filter containing filepaths in arg and then connect that to a single Script Filter exactly like I showed you last time? I give up, tbh.
  19. Your workflow works, more or less. The main issue is that your Run Script has Language set to /bin/bash but you have AppleScript in it. Change Language to /usr/bin/osascript (AS) There's probably also a second issue, however. My MailTo workflow that you've based this on doesn't output a list of email addresses, it outputs a command. That is to say, if you choose two recipients, e.g. bob@aol.com and dave@hotmail.com, the output won't be bob@aol.com, dave@hotmail.com, but rather compose 'bob@aol.com, dave@hotmail.com'. You will probably also need to change line 241 of mailto.py to alter the output. I imagine you'll want it to say arg=recipients,
  20. As it says in the stickied thread on getting help with errors, share your broken workflow, not just pictures of it. We can't tell what's wrong just from a picture or two.
  21. Probably what I'd use, as I already own it. There's no great advantage, though: you're still blindly just firing off key events in the hope that they work.
  22. That can be automated by simulating typing with AppleScript. This script should do the trick: tell application "System Events" key code 44 using option down -- OPT+/ delay 0.5 keystroke "sum" delay 0.5 key code 36 -- Enter end tell Simulating keypresses, especially like this, is a last resort, however, as it just fires key events at the application without any idea if they're working. You may need to increase the delays if your machine is slower (or reduce them if it's super-fast).
  23. Big update for version 3. Option to exclude units when copying Add per-dimensionality defaults Option to specify thousands separator Option to specify custom decimal separator Add cryptocurrencies Update Alfred-Workflow Update Pint
  24. What I said about Excel applies to every single application. Alfred is a launcher, not an automation application. Step one is to find out if/how you can do that at all with the application. Once you have a script that does what you need, Alfred can launch it. As such, you should ask on a Google forum how to automate Google Sheets.
×
×
  • Create New...