Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 05/15/2021 in all areas

  1. Scriptability matters for Alfred Workflows, so this is a short thread on what we know about scriptability on the new macOS version. Discussion and new data is welcome; I’ll strive to keep this top post up to date with the most relevant information. Scripting languages might have survived another version: Shortcuts is coming to macOS, but it doesn’t mean the end of AppleScript yet: The Shortcuts app will scriptable, though the functionality isn’t yet available. It will also have a command-line tool: On June 8 there was a session going more in-depth into Shortcuts. Notable points: “We also added two new automation types for Focus and Sound Recognition”. “By the way, if your app integrates with file providers, these new Files actions will automatically work with the files that your app provides”. “We also have a new file format that lets you distribute Shortcuts as files“. (…) “This means that you can distribute your own Shortcuts on your website or in your app”. Which means we may be able to distribute Shortcuts as complements to Workflows. For M1 Macs, that may open a window to distribute everything needed to control iOS apps from Alfred. However, it’s unclear if we’ll need a ($99/year) Developer Account to distribute them in useful form, since they mention signing: “Shortcuts files are notarized by Apple to make sure they’re safe”. (…) “a new mode for sharing Shortcuts privately” (…) “Shortcuts files are signed with the identity of the person who sent them. If you need to re-sign a Shortcut, you can use the new Shortcuts command-line tool”. “Shortcuts has full support for AppleScripts and Shell Scripting”. Not dead yet! “Shortcuts is the future of Mac automation”. Taken in isolation; it’s a scary implication the other technologies are destined for the bin. But in context, they’re talking speficially about replacing Automator. “There’s a Shortcuts command-line tool which lets you list and run Shortcuts in your Shell Scripts or command-line tools”. “If you develop an app or a script that would benefit from the ability to run Shortcuts, you should use the Scripting interface. By communicating with the “Shortcuts Events” process, your app can get a list of shortcuts that the user has set up, as well as start running one. In AppleScript, you can accomplish this by telling the “Shortcuts Events” process to run a shortcut by name”: tell application "Shortcuts Events" run the shortcut named "Make GIF" end tell “Finally, macOS Monterey also includes a command-line tool that can list shortcuts and run them by name. If you have command-line tools or scripts, they can integrate with Shortcuts via this interface”. OVERVIEW: Command-line utility for running shortcuts. USAGE: shortcuts <command> OPTIONS: -h, --help Show help information. SUBCOMMANDS: run Run a shortcut. list List your shortcuts. view View a shortcut in Shortcuts. sign Sign a shortcut file. See 'shortcuts help <subcommand>' for detailed help.
    5 points
  2. @Mr Pennyworth To find URL schemes supported by an app, reading the ${app_path}/Contents/Info.plist file and looking for CFBundleURLSchemes tag if often enough. Or doing /usr/libexec/PlistBuddy -c 'print :CFBundleURLTypes' "${app_path}/Contents/Info.plist". But I think you’ll like this more: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump URLSchemeBinding. It shows every available URL scheme (on your machine). As to how to use them, that’s the job of the developer’s documentation.
    4 points
  3. So you’ve just updated to the new buggy shininess released by Apple. Congrats! But thread lightly. At all costs, you should avoid installing a beta macOS version on a machine with data you can’t afford to lose or waste a day resetting. In the course of your beta trial, you’ll bump into bugs and general issues. Some will be related to Alfred and Workflows, which will make you tempted to jump on this forum for help. Stop! Then wait. Ask yourself “is this a bug I should be reporting?” The closer to WWDC21, the likelier the answer is “no”. The overwhelming majority of bugs at this point will sort themselves out. And they are inconsistent. At the time of writing there have been two comments from users on the new macOS beta: one said Alfred worked, the other that it didn’t. At this point the new beta is so unstable we can’t even rely on a consistent experience between users, meaning no way to isolate and understand problems—effort spent in that direction wold be wasted. Avoid drowning the forum with unactionable bug reports. In general, if you don’t have enough knowledge or skill to figure out the cause of the problem, you should refrain from installing a beta OS. Please avoid filling but reports if that’s the case. Or file them at Apple, since it’s their end causing the breaks and giving them feedback is the point of installing their beta OS. So when should you start reporting general Alfred bugs? Look at the bug reports subforum. Do you see a “macOS 12.0 Monterey Bugs & Issues” section? If not, it’s too soon. What about Workflows? You should follow the same logic. If a Workflow stops working, either the developer will know because they are using the beta, or they won’t know and won’t be able to fix it anyway because they are not on the beta. There are exceptions to the above, but few. If you do make a bug report, please make sure to follow the instructions. Do that, and everyone will be more willing to look into your issue sooner and help get you sorted. Thank you. Have fun with the new features.
    3 points
  4. I just release version 1.2.6 of the workflow, which has the following changes: Match 3 and 4 digit codes if they immediately follow "code" or "is" (e.g. "your code is 1234", "enter code 573 to log in") Thanks to @luckman212 for the PR! Download the latest release: https://github.com/squatto/alfred-imessage-2fa/releases/download/v1.2.6/iMessage.2FA.alfredworkflow
    3 points
  5. Alfred (as of 4.3) actually has a new internal URL parser which, on quickly checking, actually handles this specific scenario correctly. This URL parser is used in most places throughout Alfred, but currently not in Custom Searches and the workflow Open URL Action, as I want it to be fully tested and verified before potentially causing a regression for a highly used "working" feature in Alfred. URL parsing is in fact an extremely complex task to do correctly, as there are a number of assumptions which have to be made, which is why Apple's own APIs don't do it automatically. Alfred's parser splits the URL string into the relevant components, then uses Apple's NSURLComponents to construct and encode the URL. Just as a purely "as interest" note, here is a screenshot of the internal testing tool I created to Alfred's [future] URL parser to make it easy to see that URLs were being split and parsed correctly: Cheers, Andrew
    2 points
  6. I am unfortunately a potato... 😕 aha jk okay thank you for the reply and answer
    2 points
  7. CleanShot X Workflow: Download Requiremens Alfred 4CleanShot X (version 3.5.1 or above) Screenshots Credits This workflow is based on, and a slight improvement of, Raycast’s CleanShot X script commands. Icon Credits Some icons from by srip and freepik from flaticon.
    2 points
  8. Nvm. Found your github repo (https://github.com/deanishe/alfred-workflow/blob/master/workflow/background.py). I'll go thru this and figure out myself. Didn't expect I was getting help from special forces!
    2 points
  9. i'm going to make this change for the next release, and I'll update the documentation to mention using arg when quicklookurl is not set. If this causes a vast unexpected impact, I'll take a second look.
    2 points
  10. Summary All of the QR code generator workflows I've come across use a dependency, such as an external installation, embedded app, or web service. Given that MacOS can create QR codes natively, that's what I did with this workflow. Usage I've configured this to use two different keywords, qrc & qrp. The qrc keyword creates a QR code that copied to the clipboard. The other keyword, qrp does the same thing, except at the end it'll open the QR code in Preview to allow saving as an image/pdf. When using either qrc or qrp without a parameter this workflow will attempt to use text contained on the clipboard. This same flow is followed if you set a hotkey for the selection and nothing is selected. Download https://github.com/TorreyBetts/Alfred-QRCode/releases/download/v1.0.2/QR.Code.alfredworkflow GitHub https://github.com/TorreyBetts/Alfred-QRCode
    2 points
  11. This workflow has been updated to allow QR code creation with a selection hotkey. If either the selection contains nothing or the qrc/qrp keywords don't have a parameter, then the clipboard is used. Thanks @vitor for those ideas to improve the workflow!
    2 points
  12. Your try ... except is in the wrong place: the script will fail on read 99.9% of the time, not write. But in any case, you generally just put it around the entire per-item code: from __future__ import print_function import json import sys n = 0 # number of files processed for path in sys.argv[1:]: try: with open(path) as fp: data = json.load(fp) with open(path, 'w') as fp: json.dump(data, fp, indent=4, separators=(',', ': ')) n += 1 except Exception as err: # anything written to STDERR goes to Alfred's debugger print('[error] file %s: %s' % (path, err), file=sys.stderr) plural = ('s', '')[n==1] # anything written to STDOUT goes to the next action (i.e. arg/{query}) print('Prettified %d file%s' % (n, plural), end='') Variables and arg/{query} are two different matters, and Script Filters and regular Run Script actions are two different things again. In this case, you don’t really need to use variables, because you only need one output: the notification. So you can just print the notification text because anything you print becomes the next element’s arg/{query}. Important: If you’re going to get into writing Python, you should stop using /usr/bin/python and use /usr/bin/python3 instead. (You’ll have to use Alfred's External File option for Language and the shebang #!/usr/bin/python3 to do that.) Python 2 is dead and will be gone soon, and Python 3 is easier to use, anyway.
    2 points
  13. You'll need to set keywords for the Snippet Triggers as these are stripped from the workflow to avoid clashing with your own. For example, I've set them to these... Just keep in mind the shared prefix in your Snippet Triggers setup, so I've only set them to "tw" and so on, and the \\ prefix is set globally for all my snippet triggers. You've no doubt figured that in @dfay's example, you can set the name and address in the environment variables under the [x] in the top right of the workflow canvas You can read more about the snippet triggers object, or see the few scenarios with dynamic content within the snippets as examples too. Nested snippets and snippets trigger based workflows generally are really good fun and ever so useful.
    2 points
  14. Here’s a script that can import your macOS text replacements into an Alfred snippet collection.
    2 points
  15. Using Beeminder to track your goals? You might be interested in this workflow to manage and update your Beeminder goals. Thanks – as usual – to @deanishe and @vitor for their guidance and templates. Feedback welcome! https://github.com/giovannicoppola/beeAlfred
    2 points
  16. Please post your Workflow somewhere when asking for help. It’s not possible to debug your issue from a mostly empty screenshot and the name of a script. We have zero idea of what your code is doing.
    2 points
  17. @fxf Try "remove" or "cancel" as a keyword to search. "x": { "keywords": ["no", "delete", "remove", "cancel", "red"], "char": "❌", "fitzpatrick_scale": false, "category": "symbols" },
    2 points
  18. No idea how I missed this! Thank you! Great work!
    1 point
  19. I agree with @timtops that capitalization of snippets is a huge deficiency. Another simple example: I have set "thx" to expand to "thanks". But context matters for capitalization, for example: "I sent my thanks to John" vs. "Thanks." I would type the former keyword as "thx" and the latter as "Thx." But currently Alfred only will recognize and expand "thx" and do nothing to "Thx", which requires me to create two different snippets, one capitalized and one not. Should not be needed. I have also used TextExpander as well as aText and they both handle this. Thanks.
    1 point
  20. @jth214 The line numbers in your error log do not correspond to the source code of the current version of the workflow. It looks like you're using an outdated version. Please make sure you're using the latest version of a workflow (or any software, really) before reporting a problem with it: it may have already been fixed.
    1 point
  21. deanishe

    Shut Down a Mac?

    That's more requirement than preference. Let's assume that Andrew has added the remote-from-anywhere feature exactly as you describe it. So now we have thousands of Alfred users with a new webserver running on their machine, serving a TLS certificate every browser on the planet will show a scary warning about. It's still not accessible from the Internet, of course, because they haven't punched a hole through their firewall with port forwarding yet. That done, they still can't access their machine from the Internet because they don't know how to find their router's WAN IP or they don't know how to set up dynamic DNS. The things I've marked in bold are complex topics, and would cause lots and lots of support requests. As long as that is the case, the feature is effectively off the table.
    1 point
  22. @Chris Messina Thanks for the reminder! Been meaning to update this a bajillion times, but when I come to the forum, I just crack on with answering questions and forget every time. I've just updated it to be light grey instead so should be easier to read
    1 point
  23. Mr Pennyworth

    CleanShot X Workflow

    @paulminors I uploaded a "fix" https://github.com/mr-pennyworth/alfred-cleanshot/releases/download/0.0.5/CleanShot.alfredworkflow Can you try it and see if it works? Because I don't have Big Sur, it was not possible for me to test it. Let me know in either cases whether it works or doesn't
    1 point
  24. Reading this, it seems like if the Script Filter quicklookurl param is specifically set to an empty string or null, Alfred should respect that as not wanting quicklook for this result. The absence of quicklookurl will still be treated as it is currently, and falls back to arg. Can anybody think of a reason this would be a bad idea, or cause regressions with their current Script Filters?
    1 point
  25. Right yeah, good point: workflows keep running when a Run Script action fails, so your original version also needs some kind of hand-rolled error check before the Write Text File. But the script is inherently fail safe because it will error out decoding the file and never run the code that overwrites it.
    1 point
  26. One of my workflows logged so much, it broke Alfred.
    1 point
  27. @Chris Messina thanks! I'll get that fixed
    1 point
  28. alfred-spotify-mini-player.com Find all information on dedicated website: alfred-spotify-mini-player.com Follow on Twitter @TheMiniPlayer to get all news Features Example PS: If you have a problem with the workflow, do not spend time reading the forum post, the workflow has been rewritten many times! Follow instructions from here http://alfred-spotify-mini-player.com/articles/support/ instead
    1 point
  29. @Cyberskier apologies! The workflow right now doesn't support M1, and I'm not sure how much of a work it would be to support it. Technical details if curious: The workflow ships with compiled binaries (an entire nodejs runtime and a swift app). As they aren't universal binaries, it won't work on an M1 mac. I'm working on getting rid of nodejs right now. After that, I'll look into making the swift app universal.
    1 point
  30. @JakeS I'm going to get rid of the javascript and node-bundling altogether. Will post an update here once done in next day or two.
    1 point
  31. Sometimes, I want to see the picture clearly, it would be nice if it can support zooming in, or for example ⇧ to preview the image
    1 point
  32. giovanni

    Calculate Anything

    this link on this page
    1 point
  33. In the meanwhile, if you insist on CSV instead of excel sheets, here's a workflow for you: https://github.com/mr-pennyworth/alfred-lf2csv Example setup: 1) set hotkey to cmd+option+c 2) in the workflow editor, select the list filter you want to export as csv 3) press the hotkey (cmd+option+c), alfred should have a CSV file ready to be dragged-and-dropped
    1 point
  34. haran

    Increase width of toolbar

    @Andrew I've updated my powerpack email license. But your previous comment seems to work. Thanks!
    1 point
  35. Major update! Your usage won’t change if you don’t want to. First, I’ve done a big code cleanup. Second, the list will now auto-refresh every few seconds, which is a great way to monitor for changes. Third, I’ve revamped how the file list is cached (only applicable when sorting by added): Previously, on every run it would read from the cache unless the directory had changed, in which case it would have to save a new cache. This means that if your directory changed quite often, you’d see little gain from caching. Now, no caching is done by default. If you want caching, run :recentdownloadslaunchd which will install a launchd agent to watch your directory and save a new cache when the directory is modified. This means your cache will always be up to date and you’ll get the fastest run every time. This leverages technology built-in to macOS, there’s no weird hacks. Fourth, I’ve worked around a pesky Spotlight bug when it sometimes returns (null) in a result, which is annoying if it gets saved to the cache because you wouldn’t be seeing the real path. Finally, thanks to the above I removed the option to manually delete the cache. To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
    1 point
  36. deanishe

    introducing beeAlfred

    It does, but it's much more restrictive (gotta use GitHub releases, semantic versioning) and is more effort to integrate. @giovanni You need to remove the .pyc files and __pycache__ from the repo/workflow and add *.pyc and __pycache__ to your .gitignore. Those files shouldn’t be in the repo, and especially not the released workflow. They’re bytecode files that Python generates automatically, so you don’t need them in there, and they’re Python version-specific, so you don’t want them in there, or your workflow will refuse to run on a different version of Python.
    1 point
  37. vitor

    introducing beeAlfred

    Let me know if you have any questions, though it’s made to be easy to set up. But you’re using @deanishe’s python library, right? That has auto-updating built-in.
    1 point
  38. vitor

    introducing beeAlfred

    This makes no difference to functionality, but you might appreciate the insight. You have your last Run Script set to with input as {query} instead of with input as argv. You’ll find @deanishe often saying (and I agree) you shouldn’t really use the former but the latter. In this case it makes no difference because you’re not using an argument—you’re using variables—but there’s no reason to change the default (with input as argv) either. Also, you should probably be quoting ${slug}; in bash it’s always a safer bet to quote. Unless you want it to specifically break on spaces and make it multiple arguments.
    1 point
  39. giovanni

    Passing variable to app

    have you checked the debugger? What does it say? I noticed you had `search {query}`, have you tried without `for`?
    1 point
  40. Thank you! Alfred can do that on its own. It checks how fast you type and adds an automatic delay after each character so it tries to run as infrequently as possible, ideally only when you stopped typing. I tend to always turn that on, but this Workflow is pretty old so I don’t recall if the feature was available when I first built it. Either way, I checked and seems I forgot to turn that on. It’s now how it works (download the latest version, just released), so you should be seeing a significant decrease in requests. Thank you for noticing.
    1 point
  41. @Michal Bryxí have you added com.google.gsheet to Alfred's default results? You can do this in Alfred's Features > Default Results > Advanced. Having said that, I find that It's best to keep Alfred's default results as focused as possible, and use the file search mode for searching files. This is particularly important when you start using more features and workflows within Alfred, and will prevent the results from becoming noisy with files.
    1 point
  42. Is there a way to always have a couple of favorite folders right in the Alfred search bar for quick access? I know there is the Favorites workflow but I'd like it even faster
    1 point
  43. deanishe

    Questions from newbie

    Absolutely. Alfred doesn’t upload any data to its creators or anyone else. In theory, it's potentially risky. In practice, it's just not an issue. Alfred is too small to be an attractive target. But If someone did create a malicious workflow, there are enough paranoid users (like me) running all manner of security software that it would be quickly spotted. If you must worry about something, worry about bugs, not enemy action.
    1 point
  44. vitor

    Questions from newbie

    Welcome @bebek. To both the Alfred forums and macOS! For many (most?) of us, Alfred is the first app we install on any Mac and we almost feel useless using macOS without it. It can get that ingrained in your usage. Like every closed-source software, you have to trust its creators. I wholeheartedly trust Alfred’s team (@Andrew and @Vero) and I recommend you stick around to meet them in the forums. You’ll see they care deeply for Alfred’s users and they have everything to gain from being truthful. Plus, they’re nice people in general. That’s indeed something different, and your reluctance in understandable and healthy. You definitely should install Workflows—like any other software—from people you trust. That said: In these forums, you’ll find plenty of prolific developers with dozens of released Workflows. Get to know us and decide if you should trust us. I think you should! I’ve never heard of an invasion of privacy or security from an Alfred Workflow. In fact, most (all?) don’t even so much as have analytics! The overwhelming majority of Workflows are built in scripting languages, meaning anyone can inspect the code. Hiding something malicious isn’t too viable, especially in popular Workflows. The latter, as I don’t see myself giving up Alfred any time soon. But no software satisfies everyone’s needs and we don’t know each other, so I can only tell you what I’d recommend myself.
    1 point
  45. For those who absolutely must to have some shortcuts to open different Chrome profiles but can't use this Workflow extension, here is a little something that is very minimal but helps me navigate through my profile. You can create your own Alfred workflow, that triggers by an input with arguments. Link this trigger to a "Run Script Action" object. Configure the Script Action with the following snippet: query=$1 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --profile-directory="Profile $query" This will take your first argument of the commend and append it to the "Profile " word. Now, I have list of profiles in my chrome that I would like to open. I simply associate them with numbers in my head (I don't have that much). To help you find the number of the profile, or as a matter of fact, an actual identifier of the profile in case you have something different that just Profile #number Open your Chrome profile, type in search bar "chrome://version" You will find the profile name and its path by: Profile Path /Users/<YOUR USER NAME HERE>/Library/Application Support/Google/Chrome/Profile 1 So this number at the end is what I swap out when switching between profiles. Simple, quick hustle This by no means a production ready workflow, but for those who couldn't even try out the current workflow due to the error above and need some solutions. This what it looks like for me in the end CHROME: And SCRIPT:
    1 point
  46. Those are two different themes, as far as Alfred is concerned: Alfred doesn't have a concept of theme variants. To set your light theme, choose an Alfred theme when the macOS colour scheme is light. To set your dark theme, choose a theme when macOS is in dark mode. Alfred will remember those choices and switch between them when the OS switches between light and dark modes.
    1 point
  47. Ok, I've published v0.3.2! This should please @Bemawr and @Voland and any other Tweetbot users! (Albeit, Tweetbot has a much more limited set of URL schemes to work with). 🎩 Download the latest. Changelog [v0.3.2] - 2020-09-06 Fixed Quick fix for missing non-personalized `users` query. [v0.3.1] - 2020-09-06 Fixed Replaced “(from:{var:account})” with “from:{var:account}” (no parens) from app searches. Fixed on errant search that targeted videos rather than all tweets. [v0.3.0] - 2020-09-04 Added Support for Tweetbot URL Schemes by setting tweetbot as platform variable (thanks @bemawr!) (Closes #3) Support for nearby searches: tweets photos videos users keywords to go to: hashtag page topics Alternative keyword ! for notifs Descriptive notes in Workflow OneUpdater (Closes #6) Changed Added service and domain variables to make it easier to develop other Toolkits Drastically increased support for Twitter for Mac thanks to new routes included in 8.34 (thanks @nolanobrien!) (Closes #4) Removed followees keyword
    1 point
  48. Sure, but it does a crap job of fill-in snippets, which is what this thread is about. EDIT: I think I've been talking about something different to everybody else. Alfred is fine for inserting a single placeholder. It's a bad fit for multiple placeholders, however, which is what I fundamentally associate fill-in snippets with.
    1 point
  49. @mattbovett Just implemented Bookmark Search Since I am not using Browser Bookmarks please test and let me know if there are issues.
    1 point
×
×
  • Create New...