Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 10/13/2019 in all areas

  1. 2 points
    Thanks Vitor!! This is the very first Alfred Workflow I have downloaded and used, and it works great!! I am very, very, very new to Alfred and all things having to do with running commands in terminal and workflows using Alfred, etc... I feel like I have opened up a whole new world of fun stuff to learn and use with my computer (Mac) and have you to thank. I remember in 4th grade when I first was taught basic Algebra (2 - x = 5) and I was blown away at this new way to solve a problem, and felt so excited about Math and this fun new way to think. Unfortunately I went a different way in my life then was good for me - and only now at 45 years old do I have the motivation to learn something new. After using these workflows and learning about commands in terminal, etc.. I feel just like that kid in 4th grade, with my mind open and am looking forward to this new journey. Thank you so much! iMan
  2. 2 points
    It's only a couple of lines, so it's probably easier to show you than to explain. This workflow will do what you asked for.
  3. 2 points
    deanishe

    Add keyword action to update Alfred

    It would save you a handful of seconds per month, Niki…
  4. 2 points
    @akido Type "reload" into Alfred to force the application cache to be refreshed; You're seeing the pre-Catalina and Catalina location for your apps, so reloading will remove any old legacy locations. Cheers, Vero
  5. 2 points
    @MVR London Did you type "reload" into Alfred? This will refresh the app cache for any apps that may no longer exist in the old location. Cheers, Vero
  6. 1 point
    @luckman212 Thanks for spotting this - I'll get it fixed in the next release
  7. 1 point
  8. 1 point
    Why are you grabbing the file location via AppleScript invoked by a Keyword, instead of using a File Action Trigger? That’s the best tool for the job. You can even prevent the Workflow from messing up by having the File Action Trigger only work on the +public.text type. On another note, cat "$1" | pbcopy is a useless use of cat. Do pbcopy < "${1}".
  9. 1 point
    https://forum.latenightsw.com/t/how-do-i-copy-image-file-to-clipboard-and-retain-format/590/27
  10. 1 point
    vitor

    Append Clipboard Customizable Key Shortcut

    Welcome @Terminal, You can do this with a Workflow. Connect a Hotkey Trigger to a Copy to Clipboard Output. On the Hotkey Trigger, set Argument to Selection in macOS; on the Copy to Clipboard Output, check Automatically paste to frontmost app and on the text box write: {clipboard} {query} Here’s a ready-made Workflow.
  11. 1 point
    Acidham

    Chromium Bookmarks and History Search

    https://github.com/Acidham/chromium-hist-bookmarks
  12. 1 point
    You'd need to change the line that splits the query from $args = explode(',', $argv[1]); to something like $args = preg_split('/(,| )/', $argv[1]); (Please note, that's completely untested.)
  13. 1 point
  14. 1 point
    deanishe

    Combining workflows

    You can call other workflows via External Triggers (which is what your first link is talking about), but that requires the workflow you’re calling to provide an appropriate External Trigger (or a place to attach one), and your workflow to know the correct argument(s) to pass to it. I don’t think trying to use other workflows would work, though. Like, a Chrome bookmarks workflow isn’t going to provide an Open Bookmark action that accepts anything other than a bookmark ID or (more likely) the URL. So you might as well open the bookmark from your own workflow seeing as it will have to know the URL anyway. I don’t know PHPStorm, but I presume it has a command-line command that opens the current directory in the app like Goland does. So all you need is the project path. Then you can use Alfred’s Terminal Command to open the directory in iTerm, PHPStorm and Finder in one single, simple command.
  15. 1 point
    I'm running Catalina, and Alfred 4 (build 1118). When typing "Photoshop" or "Illustrator" into the Alfred input field neither app shows up. They both show up when using the Spotlight search. I've checked the Spotlight settings and `/Applications` is indexed, and in fact other apps in that same folder show up just fine. I've performed the `reload` command in Alfred several times. I've also completed the `rebuild macOS metadata` command. Here's the Photoshop meta data using the Alfred metadata tool.
  16. 1 point
    Hi there, I was getting the same errors which were quite frustrating. Adding Alfred here has seemed to work for me.
  17. 1 point
    I've now improved the dropdown sheet for rebuilding the metadata to be more clear on the processes needed, and updated the .Spotlight-V100 path for Catalina instances too.
  18. 1 point
    @bivalvegruff See https://github.com/jsumners/alfred-emoji/issues/35. We're waiting on some upstream dependencies before we can do this.
  19. 1 point
    vitor

    Dismiss Alfred: ^[ as ESC

    Welcome @atlas, You can achieve this in a Workflow by connecting a Hotkey Trigger to a Hide Alfred Utility.
  20. 1 point
    Currently the UI options allow a max of 9 results, however, on larger displays it will be great to be able to show more than that.
  21. 1 point
    Martien Oranje

    Todoist Workflow

    Alfred deprecated their beta API that's the error you are getting. Update your workflow to the latest version and you should be fine.
  22. 1 point
  23. 1 point
    I'm going to look at fixing this for 4.1, and also bringing across the options from the Script Filter when you select "Alfred Filters Results" for consistency. Cheers, Andrew
  24. 1 point
    Kaihao

    [1.6] Get App Icon

    To fix this, you can add this after line11 of file acshell.sh LIST+=$(find /System/Applications -maxdepth 2 | egrep -i "\.app$" | grep -i "$QUERY") Then it works for most of system apps. But Catalyst Apps, like Podcast.app, still doesn't work. As their internal structures(Info.plist and icns files) are different from the AppKit apps. I don't know how to fix this.
  25. 1 point
    Vero

    Search email?

    @Nooblet Welcome to the forum Which version of macOS are you using? If you're using Mojave and earlier, you should be able to get this workflow working. However, if you're on Catalina, it's not currently possible to search email; Apple have removed access for third-party apps to Mail.app results by excluding it from the Spotlight metadata that apps like Alfred can use to return results. I'll keep the thread linked above updated if Apple change anything sufficiently for us to search email again. Cheers, Vero
  26. 1 point
    Kaihao

    [1.6] Get App Icon

    A simple Fix for Alfred 4.0. Right click the workflow, select "open in Finder". Open file acshell.sh. Then Change all the tell application "Alfred 2" to tell application "Alfred 4" Done!
  27. 1 point
    deanishe

    (faster) Menu Search

    A slightly awkward solution was posted here. That workflow's written in Go, but it's the same problem (alfsubl is the name of the executable in that workflow; change as appropriate).
  28. 1 point
    In macOS Catalina, Apple have removed access for third-party apps to Mail.app results by excluding it from the Spotlight metadata that apps like Alfred can use to return results. As such, the workflow won't return any results, as macOS no longer returns any Mail results. Here's a thread including responses from an Apple employee explaining what's happened to the Spotlight index. Within this thread, there's a somewhat possible workaround of copying the Mail folder to a different folder within your Home folder (e.g. in Documents), it becomes indexable. However, we can't advise doing this and you'd be doing so at your own risk, as it could cause other issues. https://forums.developer.apple.com/thread/121187#379221 We are hopeful that Apple will realise that this is necessary to third-parties and bring this back. Cheers, Vero
  29. 1 point
    It would be nice (especially for larger iPads) to have the option to have more icons displayed on the Alfred Remote app. The icon size could be decreased (and/or there could be an option to hide the pages on the left). I would personally love 30+ icons on the iPad remote.
  30. 1 point
    bikeNik

    Alfred-Anki

    @Artyom Try this release and install as anki.alfredworkflow
  31. 1 point
    deanishe

    Converting Files (PDF to JPEG)

    Not directly, no. Alfred is a launcher, not an automation app. It is designed to run things when you tell it to, and its native integration with other applications generally doesn't extend beyond telling them to open things, and in some cases, allowing you to search for the thing to open (e.g. 1Password or browser bookmarks). Alfred can run your Automator workflow for you, though. Or an AppleScript (or shell script etc.). But essentially, if you want to do more than just open something, it's up to you to first write the script/Automator workflow to do what you want, and then tell Alfred how you'd like to run it (keyword/hotkey).
  32. 1 point
    See the pic below for an example
  33. 1 point
    I'm having exactly the same behaviour when I'm working in Final Cut Pro - It looks like it might be something to do with GPU usage (my Mac has a separate GPU). If I minimise FCP and wait for a few seconds and then re-open Alfred, it works. I didn't know that Classic would behave normally - just tried that now and it seems OK. Maybe it's something to do with transparency on some of the appearances? I've tried disabling Automatic Graphics Switching and the issue keeps happening - maybe it's to do with how Alfred renders while something else is using the GPU?
  34. 1 point
    This is very simple to do with Keyboard Maestro. All you'd need to do is tell Keyboard Maestro that when you press the secondary keystroke to send the primary keystroke.
  35. 1 point
    This is now the actual location of apps in Catalina. Andrew is planning on adding a bit of logic to be able to show the virtual locations of the apps (/Applications/.../) in a future release Cheers, Vero
  36. 1 point
    @gingerbeardman Thanks for this great workflow, this is exactly what I needed! Are there any new developments since? I was looking at your script and have a suggestion which might be less prone to changes in the UI. You could replace the search/input part: set value of text field 1 of group 2 of toolbar 1 of window "Keychain Access" to q click button 1 of text field 1 of group 2 of toolbar 1 of window "Keychain Access" To something like this, using the menu bar instead: click menu item "Find" of first menu of menu bar item "Edit" of first menu bar keystroke q
  37. 1 point
    wandering

    Toggle grayscale/greyscale

    Got a 404. So I made one myself: You can find it here: https://www.packal.org/workflow/grayscale-switch
  38. 1 point
    xeric

    Workflow for Outlook V16 Search

    @multicolor 0.1.6 provides a inline message function that after you input olknew {mail address}, there's one more option 'Send a Direct Quick Message' which guide you to next step that input message content and send it without activating Outlook window. https://github.com/xeric/alfred-outlook/releases/tag/0.1.6
  39. 1 point
    Sam Michel

    Bluetooth Toggle

    Very handy script, but it stopped working for me with Mac OSX Mojave. I found this alternative AppleScript which seemed to do the trick - just replaced the Run NSAppleScript section of the workflow and it works now: #!/usr/bin/osascript on alfred_script(q) tell application "System Preferences" reveal pane id "com.apple.preferences.Bluetooth" -- activate set the current pane to pane id "com.apple.preferences.Bluetooth" try tell application "System Events" to tell process "System Preferences" click button "Turn Bluetooth Off" of window "Bluetooth" click button "Turn Bluetooth Off" of sheet 1 of window "Bluetooth" of application process "System Preferences" of application "System Events" end tell delay 1 on error tell application "System Events" to tell process "System Preferences" click button "Turn Bluetooth On" of window "Bluetooth" quit end tell end try end tell end alfred_script
  40. 1 point
    Kim Aldis

    Python 3 Support?

    Resurrecting this; Python 2.7 comes to end of life next January. I wondered what your thoughts are
  41. 1 point
    GuiB

    Cardhop Workflow

    @michaelwills sorry for the long delay! I got too much work on my side with no free time. Things are starting to settle down Sorry that the nofile.io link is not working anymore. Actually, I had a small update on my side that I needed to push here ;) So here it is: Update Version 1.2.5 What’s new: Cardhop Actions list should be in your own language (I’m getting the localization from the Cardhop application directly, so you should get the same thing as in the application) Some bugs fix Download link: https://d.pr/f/rQTPtu @michaelwills regarding the coffee, actually, I like pretty much all kind of coffee :) I’m not very difficult All the best!
  42. 1 point
    rshah

    open finder folder as tab ??

    Hate to bring back an old topic, but I found a permanent, MacOS-based solution to this after speaking to the wonderful senior support at Apple (h/t Nick at Apple, 1109457). To force folders in Alfred searches to open in Finder tabs: Go to Apple > System Preferences > Doc Set "Prefer tabs when opening documents" to Always. I'm doing this on on macOS 10.14.3 (18D42). Works like a charm. You are welcome.
  43. 1 point
    This is a great workflow, and thank you. Unfortunately it won't work if you use a tool like Bartender that moves the bluetooth menu item off the main bar (or if you don't want the bluetooth menu item displayed). For us cranks it's harder; I installed a command line tool called Bluetooth Connector and made a simpler less friendly workflow than yours that I named "Toggle my airpods" that just calls the command line /usr/local/bin/BluetoothConnector 4c-32-75-c2-09-b4 (because that's the MAC address of my airpods; yours would be different) I personally suggest people find a way to be less stubborn than me and just use your workflow but I thought I'd post this for the unfortunate souls like me who find this post.
  44. 1 point
    Note: This post is out of date as of Alfred 3.6 (which introduced AppleScript functions to set and remove variables). There is an updated version on my own site: Workflow/environment variables in Alfred. This post will not be updated due to the difficulty of editing complex posts using the forum software. Sorry. This is a brief look at how to get, set and save variables in code (i.e. in Script Filters, Run Script Actions, etc.). In Alfred 2, you had one single variable to work with: the {query} macro. Alfred 3 adds the ability to specify as many variables as you want. Alfred's own help provides a great description of working with variables in Alfred's own UI. I'm going to look more closely about getting and setting workflow/environment variables in your own code within a workflow. First of all, it bears mentioning that all variables are strings. Sure, you can set a variable to a number in JSON, but when it reaches your next script or one of Alfred's Filter Utilities, it will be a string. If you set a variable to an array (e.g. [1, 2, 3, "mach dat Mäh mal ei"]), Alfred will turn it into a single, tab-delimited string ("1\t2\t3\tmach dat Mäh mal ei"). Setting variables There are several ways to set variables. The most obvious ones are in the Workflow Environment Variables table in the workflow configuration sheet and using the Arg and Vars Utility. The configuration sheet is largely without magic, but in an Args and Vars Utility, you can use variable expansion macros: {query} expands (as always) to the input (which may be a user-entered query or the output from a previous Action), and you can use {var:VARIABLE_NAME} macros for your own custom variables. This is described in detail in the above-mentioned help pages. More interestingly, you can also set variables via the output of your scripts (i.e. dynamically) by emitting appropriate JSON. How you set variables depends on whether you are using a Script Filter or a Run Script action. You must use the appropriate mechanism, or it won't work. From Run Script actions Let's say your script outputs a URL, e.g. https://www.google.com. Normally you just do print('https://www.google.com') (or echo or puts) and that gets passed as the input to the next action. To also pass variables, you instead emit JSON in a very specific format: {"alfredworkflow": { "arg": "https://www.google.com", "variables": {"browser": "Google Chrome"}}} The root alfredworkflow object is required. If it's missing, Alfred won't parse the JSON, but will pass it as-is as input to the next action (which can also be very useful). Your output (i.e. the next Action's input/{query}) goes in arg, and any variables you wish to set go in the variables object. From Script Filters You can also set workflow variables via Script Filter feedback at three different levels: the root level, the item level and the modifier level. (Note: This only applies to JSON feedback; XML feedback is now deprecated and does not support the features described here.) In each case, variables are set via a variables object at the appropriate level (feedback root, item or mod). Root-level variables Root-level variables are always passed to downstream elements regardless of which item is actioned. They are also passed back to the same Script Filter if you've set rerun, so you can use root-level variables to implement a progress bar. browser is set to Safari for all items: {"variables": {"browser": "Safari"}, "items": [{"title": "Google", "arg": "https://www.google.com"}]} Item-level variables Item-level variables are only passed downstream when the item they're set on is actioned, and they override root-level variables. Root-level variables are also passed downstream when you action an item. browser is set to Safari by default, but Google Chrome for Reddit: {"variables": {"browser": "Safari"}, "items": [ {"title": "Google", "arg": "https://www.google.com"}, {"title": "Reddit", "arg": "https://reddit.com", "variables": {"browser": "Google Chrome"}}]} Modifier-level variables Modifier-level variables are only passed downstream when the corresponding item is actioned with the appropriate modifier key pressed. They replace item- and root-level variables (i.e. if a modifier sets any variables, Alfred ignores any root- and item-level variables). As above, browser is set to Safari by default and Google Chrome for Reddit. But you can also pass browser=Google Chrome for Google by holding ⌘ when actioning it: {"variables": {"browser": "Safari"}, "items": [ {"title": "Google", "arg": "https://www.google.com", "mods" {"cmd": {"variables": {"browser": "Google Chrome"}}}}, {"title": "Reddit", "arg": "https://reddit.com", "variables": {"browser": "Google Chrome"}}]} Using variables So you've set a few variables, and now you want to use them. Within Alfred elements like Arg and Vars or Filter Utilities, you use the above-mentioned {var:VARIABLE_NAME} macros. Very simple. Where it gets a little more complicated is in your own code. First and foremost, {var:VARIABLE_NAME} macro expansion does not work in Run Script Actions (or Run NSAppleScript). When Alfred runs your code, it does not use {var:...} macros, but rather takes any workflow variables and sets them as environment variables for your script. Using the above example again, Alfred would pass "https://www.google.com" to my script as input (either via ARGV or {query} depending on the settings) and it would set the environment variable browser to Safari or Google Chrome. How you retrieve environment variables depends on the language you're using. Accessing environment variables in different languages In bash/zsh, the variables are already in the global namespace. Just use $browser In Python, use the os.environ dictionary or os.getenv('VARIABLE_NAME'): import os browser = os.environ['browser'] # Or browser = os.getenv('browser') In AppleScript, use system attribute: set theBrowser to (system attribute "browser") In JavaScript (JXA), use $.getenv(): ObjC.import('stdlib') var browser = $.getenv('browser') In PHP, use getenv(): (Please see this comment by juliosecco on why you should use getenv() over $_ENV.) $browser = getenv('browser'); // Or $browser = $_ENV['browser']; In Ruby, use ENV: browser = ENV["browser"] Saving variables NOTE: This section is out of date as of Alfred 3.6. Please see the updated version linked at the top of the post. As amoose136 points out, any variables you set in a running workflow are not saved. They exist as long as the workflow is running and then disappear. Any Workflow Environment Variables will "reset" to their values in the workflow configuration sheet on the next run. Generally, this is what you want, but sometimes you want to save a variable's value. For example, you might have an API_KEY Workflow Environment Variable in the configuration sheet. The user can enter their API key for the service in the configuration sheet, but you'd also like to add the ability to set it from within your workflow, e.g. with a setapikey Keyword and corresponding Run Script action. WARNING: As of Alfred 3.4.1, Alfred takes several seconds to notice when info.plist has been updated by something other than itself. As a result, relying on altering info.plist programatically can be problematic, as Alfred won't notice the changes for several seconds (5–10 seconds is typical on my machine). If you update a workflow variable in info.plist and run your workflow again immediately, it is unlikely that Alfred will have picked up the change. The Workflow Environment Variables are contained in the variables section of info.plist. Consequently, to update them, you need to update info.plist. Regardless of which language you're using, you can call the PlistBuddy program to alter Workflow Environment Variables: # Set a variable /usr/libexec/PlistBuddy -c "Set :variables:API_KEY \"ABC-XYZ\"" info.plist # Delete a variable (i.e. remove it entirely from Workflow Environment Variables) /usr/libexec/PlistBuddy -c "Delete :variables:API_KEY" info.plist In Python, there's no need to use an external program, as it has the built-in plistlib library: from plistlib import readPlist, writePlist # Read info.plist into a standard Python dictionary info = readPlist('info.plist') # Set a variable info['variables']['API_KEY'] = 'ABC-XYZ' # Delete a variable del info['variables']['API_KEY'] # Save changes writePlist(info, 'info.plist') (Note: plistlib only works with XML property lists, which is fine for info.plist, but using PlistBuddy is generally more robust.) Don't forget: any changes you make to info.plist only take effect the next time the workflow is run. This likely doesn't matter in most cases, but if you need a variable to be updated immediately (i.e. also for the current workflow run), you must also set it "live" using one of the methods described in the Setting variables section above.
  45. 1 point
    Variables don't work that way. See the pinned thread:
  46. 1 point
    Call top for an auto-updating list of processes, ordered by CPU usage. Type to filter by process name. On each process: ⌘↵ quits. ⌥↵ forcibly kills. ⌃↵ limits CPU usage. fn↵ lowers priority (increases niceness). ⇧↵ freezes. ↵ gives more granularity over the options. Download | Source
  47. 1 point
    vitor

    BugNot — Get logins from bugmenot

    Call bn with a website address and the Workflow will fetch the available logins with the corresponding success rate. If you had the login box selected prior to calling the Workflow, hit ↵ and it’ll automatically type the username, hit ⇥ and type the password. If for any reason that did not work or you just want one of the details, use ⌃↵ or ⌥↵ to copy the username or password (respectively) to your clipboard. Download | Source
  48. 1 point
    Hongbo Miao

    Bluetooth Toggle

    Thank you!
  49. 0 points
    Hello @hzlzh, After a long, but very pleasant, support call with Apple, we came to the conclusion that it is not Catalina, nor Spotlight itself that has an issue. Rebuilding, re-indexing, cleaning: whatever I did was not making any difference. I created an admin and standard user to double-check and see if it would be a user profile issue, or a system-wide issue. We sifted through the logs and checked all apps on my system. Since I used all tricks in the book, using all different tools I could think of, there was nothing else to look for: it is an app that interferes or prevents Spotlight to get access to the information. Long story short: in the end I uninstalled every app that could have an influence, notably 3rd party security-type apps, such as firewall, backup, anti-virus/malware. But also preference panes, extensions and other things that have nested on my system over the years. Not all are up-to-date, not all follow the latest requirements of the system. I am yet to find out which was the culprit. I have to find time to re-install and reproduce the problem. My question to you: are you using apps such as Avast, Malwarebytes, Acronis, LittleSnitch, Parallels....? Any of those may have services, helpers or daemons running that interfere.
  50. 0 points
    akaralar

    EggTimer v2 [updated to 2.0 final]

    the `recent` option seems broken for me, even in the version @Russell Davis provided, on macOS 10.14 Mojave. I can't see the alarms I'm setting after typing `recent`, it says there are no alarms or timers set. Does anybody else have the same problem?
×
×
  • Create New...