Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    523

Everything posted by deanishe

  1. You should be checking the URL yourself to make sure it actually points to an imgur album before you try to download it. As for killing the workflow halfway through a download, why don't you have Alfred run it in Terminal/iTerm so you can CTRL+C when you've got the images you need?
  2. Oh sorry, there's a new Call External Trigger Output, but that's only in the beta version at the moment. This workflow I'm currently working on uses AppleScript to restart the workflow. Check out the yellow and green actions on the right (the notes on the elements mention that they call External Triggers). What's wrong with the tell application "Alfred 3" to search "co " AppleScript?
  3. It works just fine for me. How exactly are you launching the scripts? You have iTerm set as the default application for shell scripts?
  4. Okay then. The best way to do this is probably to simulate the CMD+OPT+Right Arrow keypress with AppleScript, like this: tell application "System Events" to key code 124 using {command down, option down} In an Alfred workflow, put that in a Run Script Action with Language = /usr/bin/osascript (AS). It's up to you to ensure that Finder is the active application and the correct folder is selected, however. If you want to automate that, too, this will show your home folder in Finder in List View: property theTarget : get path to home folder tell application "Finder" activate tell front Finder window set current view to list view reveal theTarget end tell end tell Can't say much more than that without more details of precisely what you want to do (open the same folder every time, choose the folder to open in Alfred etc.)
  5. Either I don't understand what you want or you haven't even tried what I suggested. OPT+Click, not just Click.
  6. You should use echo $PATH > /dev/stderr instead. STDOUT is only for the data Alfred should pass to the next action. If you write anything else to STDOUT, your workflow won't work as expected. If it's a Script Filter, you will break it completely by invalidating the XML/JSON output. In the debugger, set Log to "All information" instead of "Interesting information". That will also show element input/output (i.e. STDOUT).
  7. What do you mean "unfold all folders in a directory"? In Finder using List View? If that is what you mean, OPT+Click on the triangle does that. Alternatively, you can select one or more folders and use CMD+OPT+Right Arrow to expand all folders recursively. CMD+OPT+Left Arrow collapses them again.
  8. Use a Run Script Action with Language = /usr/bin/python with input as argv Script: import re import sys print(re.sub(' +', ' ', sys.argv[1]))
  9. tell application "Alfred 3" to search "co " is precisely what you want. search is Alfred's command to open its main query window. In the most recent versions of Alfred, you can also use Call External Trigger to tell a workflow to "restart" itself.
  10. If you want to search the files in a specific (unchanging) directory, see File Filters. If you also want to choose the directory to search in first, check out the Dynamic File Search example workflow included with Alfred. (Go to Alfred Preferences > Workflows, hit the + (plus) button at the bottom and choose Examples > Dynamic File Search).
  11. Searching attachments should work if you add the appropriate folders to Alfred's Search Scope. For Mail.app it's ~/Library/Mail and for Airmail it's ~/Library/Containers/it.bloop.airmail2/Data/Library/Application Support/Airmail (it might be airmail3 on your system). This will also enable you to search Mail.app emails using File Search, but not Airmail ones because it doesn't store messages in a format supported by the system metadata indexer (which Alfred and Spotlight both use). You could also use a File Filter to specifically search emails and/or attachments. That might be a good idea for attachments, to keep them separate from your own documents.
  12. Please don't ask users to install gems globally to make your workflow work. It's bad practice and user-unfriendly. There's a good chance your workflow will break something else, or that some other software doing the same suspect thing will break your workflow (because they require different library versions, and Ruby doesn't support versioned libraries). Please bundle any dependencies with your workflow. That way it will work out of the box, won't cause problems with other software, doesn't require users to mess about in Terminal, and it will also sync seamlessly between machines. And when you update the dependencies, users won't have to go through it all over again. They can just install the new version of the workflow.
  13. Did you forget to post a link to the actual workflow?
  14. The following AppleScript will invoke Alfred: tell application "Alfred 3" to search "" Put that in a Run Script Action with Language = /usr/bin/osascript (AS) and trigger it from Hotkey Action(s).
  15. Here's the build script I use. It's tailored to Python and the Alfred-Workflow library, so you'd probably want to change it (i.e. it excludes Python-specific files from the build and reads the workflow version number from a version file, which Alfred-Workflow expects to be present).
  16. Alfred considers "System Preferences" a better match than "Preview" because Alfred learns from your choices and you've selected that result (by accident) a few times. Enter "pre" in Alfred and select Preview 2–3 times, and it should once again be the top result.
  17. In theory, yeah. The pitfall is that it's difficult to know when the file is open and therefore when to trigger select all and copy. You probably have to simulate CMD+A and CMD+C for the select all and copy (and CMD+V for the paste).
  18. This script moves the mouse cursor to the centre of the frontmost window. Put it in a Run Script action with Language = /usr/bin/osascript (JS). I have no idea if it works with multiple monitors. ObjC.import('stdlib') ObjC.import('CoreGraphics'); // Move mouse cursor to specified position function moveMouse(x, y) { var pos = $.CGPointMake(x, y); var event = $.CGEventCreateMouseEvent(null, $.kCGEventMouseMoved, pos, $.kCGMouseButtonLeft); $.CGEventPost($.kCGHIDEventTap, event); } // Run script function run() { var app = Application.currentApplication(); app.includeStandardAdditions = true; var win = app.windows[0], bounds = win.properties().bounds; // Calculate centre of window var x = Math.trunc(bounds.x + (bounds.width / 2)), y = Math.trunc(bounds.y + (bounds.height / 2)); console.log('centre = ' + x + 'x' + y); moveMouse(x, y); }
  19. There is no file. @tamthanhone: You should export and upload the .alfredworkflow file, so people can simply download and install your workflow instead of having to rebuild the whole thing themselves.
  20. Alfred is not a replacement for Keyboard Maestro (what is?). They are entirely different kinds of applications. Workflows, at heart, allow you to put your own data into Alfred's GUI, select an item and perform an action on/with it. Alfred is not suited to automating other applications. Workflows that work with other applications are more like hyper-convenient Quick Entry or Quick Search features, i.e. one-shot actions. If you try to use Alfred for any kind of multi-step automation, like filling forms, you'll basically be doing 99% of the work yourself in AppleScript and just using Alfred to run the script.
  21. I dunno if it's worth the price to you, but Typinator can do pretty much everything you'd ever want from a snippet expander.
×
×
  • Create New...