Jump to content

amoose136

Member
  • Posts

    28
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by amoose136

  1. from __future__ import print_function print('{:.2f}'.format(42.022345545456)) Will return 42.02 You could you pyperclip to write to the clipboard or pass the object along to the Alfred clipboard object. Dean Jackson's Alfred-Workflow library can handle the interface with Alfred if you need more complexity.
  2. I made something similar here using unicode: https://github.com/amoose136/Alfred-Unicode-Math-Snippets
  3. Regarding caching, perhaps you could create a hidden folder with a custom file type that contains the item json from a result from a workflow. This folder could be added to the Alfred scope and the file type (possibly .item or something similar) could also be added. Actioning the item could trigger the workflow it came from and figure out what to actually do on runtime. The only part not handled is expiration of items as the workflows wouldn't actually run to check if items need to be flushed until an item is called. Ideally you'd want the ability to have these files self delete after some time even if the workflow hasn't been recently called.
  4. As of the most recent update today (2.2), the number format checking has been removed. Adding it was based on some falsehoods. I also implemented a workaround for an Apple Event Handler failure that occasionally appears in recent macOS updates and causes FaceTime to open instead of contact calling to happen. A complete python rewrite is in the works to fix some of the bigger issues.
  5. So I was hopeful you might have found a better way of finding contacts but it looks like you're still using my script almost verbatim right now. My way works but it's necessarily slow (I even had to add that .5 s delay in there for stability) and doesn't handle multiple numbers on a single contact or allow you to set the results' icons to their corresponding contact pictures if they have one. Stay tuned though because I'm rewriting mine currently in python to handle these cases.
  6. Alfred is fairly consistently slow the first time I open it after not using it for a few hours. By "slow" I mean the window pops up but is frozen for about 2-4 seconds before anything you type appears in it during that window of time. After that 2 seconds, everything that was typed appears all at once. I don't know what is causing this. I have a bunch of workflows but none of them should be running until they are selected... Are there any startup diagnostics tool to figure out what the cause of this slowness is? Without some kind of tool to isolate what is causing the error I don't know how to tell other people how to make Alfred replicate the behavior.
  7. A snippet pack to make putting the true unicode equivalents of things like :sparkles:, :lipstick:, and other emojis used in git commits easier to type. It gives them names relevant to coding. Of course the official gitmoji has a CLI but suppose you want to use an IDE or don't want to install npm but already have Alfred Powerpack, or you just want a more inline way way of adding emoji, or you want the emoji to work with $git log (e.g. :sparkles: will not be interpreted by git log); if so, this is for you. Examples: :sparkles: -> :add: Because one uses ✨ when adding new features :penguin: -> :lin: Because one uses ? when making linux related changes :checkered_flag: -> :win: Because one uses ? for windows related changes :heavy_plus_sign: -> :+dep: Because one uses ➕ when adding dependencies etc.. Added benefit of making emojis appear with $git log because they are just unicode after using this. Inspired by: https://gitmoji.carloscuesta.me/ And also: https://github.com/atom/atom/blob/7929e261a0d6e78ff4ca5196c8b385946e64dbd9/CONTRIBUTING.md#git-commit-messages Full mapping details and download is available on the github
  8. Hmm perhaps someone will integrate this into the video downloader workflow.
  9. Excellent. I already have a few ideas on how to use this.
  10. I have a couple questions. How does Alfred know where "Alfred.alfredpreferences" is? Mine is synced via Dropbox but in principle my Dropbox folder could be anywhere. Within Alfred.alfredpreferences/preferences/local there are 5 folders with long (pseudorandom?) strings that I assume are uuids for something. Within each of these the structure is mostly the same but only one appears to contains the plists that actually control Alfred. How does Alfred know which folder this is? I assume that each folder corresponds to a different computer/Alfred install or something but I still need a way of finding what the right uuid is.
  11. Building on what Deanishe said in the previous thread, I found this. If you make it run an applescript to trigger an Alfred workflow you could have self calling workflows if you want. It's not accessible certainly but it's still possible.
  12. Lets you write things like ⌘⌥⇧␣⎋ with ease. Screenshot/List of Snippets Download Download latest from releases. Released under Unlicense / Public Domain. http://unlicense.org/
  13. So there's an autoexpand snippets toggle check box that I find myself opening the settings gui to toggle far too often. I use a number of snippets but it isn't the best to have the autoexpand feature on when coding for example. Two possible solutions: add blacklist of applications the text expansion service should ignore or make api so the this setting can be toggled from a workflow. I would have already made a workflow actually but I'm not sure where Alfred stores this setting.
  14. I concur with the above. Focus on the desktop app until Apple takes a better approach to keyboards. Even the top rated 3rd party keyboards have significantly slower startup times than the stock iOS keyboard so in my mind they're not worth it at the moment. A .5-1 delay at every keyboard open is just too much. Right now I manually added my most import text replacements to the iOS system text replacement service. It's supposed to sync with the laptop via iCloud but that part has been broken for the entire life of iOS 9 and most of 8. The other super painful part is each snippet must be added by hand. I might be able to make a stupid sideloaded app (because it would never have Apple's blessing in a million years) that would import snippets from a csv file but that's not terribly likely and very low on my priorities.
  15. Although I think it usually best if options are accessed through workflow feedback and keyboard controls, would it be possible to add support for notifications with response buttons to Notify.app? For some options you might want to deliberately slow down a choice if the script/workflow is about to do something that will take a lot of resources. In the apple developer documentation examples (see (void)showNotificationAlert) it doesn't look like it's that hard to create notifications with buttons.
  16. I'm sorry this isn't entirely clear to me. I don't have a script filter right now. I have a file filter that works but I want to replicate the behavior of the default file-filter block using a script filter. In particular I'm searching through contacts from Address Book right now and rather than just show the contact name, the default contact icon, and "View in Alfred", I'd like it to be the contact name, the contact's picture if it exists as the icon, and the subtext can be any option I choose from the contact card. What you seem to be suggesting is that I generate xml for all the contacts and pass that to Alfred and let it filter it down. This seems like it would be slow if you have a lot of contacts. I guess I could cache this xml somewhere and update it in the background each time the script is run but that doesn't seem very elegant. I would think you would just run the script on a partial match of the first few characters (1 or 2) so as to dramatically reduce the subset and then filter it from there.
  17. This workflow is currently in beta. Please report bugs. This workflow uses NOAA's servers so it only works for North America. My deepest apologies to people of other countries but I couldn't find a free, fast, global radar source that is also easily hackable. Note that these radar images are base reflectivity so when there is no rain there will be a lot of noise near the center. Weather channels typically filter this out but just look at the legend and it's easy to tell what's what. Screenshots Installation Download latest version from Github. Double click to install. Workflow auto notifies of new versions and will update itself if you action the notification of a new update. Update checks may also be forced using radar:update The version number can be displayed via radar:version Usage First time you run this set your location by typing radar [location]⏎ Where [location] is replaced with your current location. If all goes well it will autocomplete locations from WeatherUnderground's autocomplete API. Actioning a location will send that location's longitude and latitude to NOAA's servers to find the weatherstation short code (3 characters in all caps) closest to that location. To manually set this shortcode edit the environment variable 'ws' to the desired shortcode then activate Alfred and type radar⌥⏎ From there the workflow will download the temporally unchanging topographical map and overlay parts (roads, counties, and city names) and compile and cash those parts. After this is done normal operation should just be done by using the key word: activate Alfred and type radar⏎ A static image should display with quicklook within 3 seconds on decent internet. If you don't close quicklook (space or escape) the workflow will download and compile some more images into an animated gif and display this instead. Bugs When (not if) you find bugs just type radar:update to make sure you're on the latest version (auto update checks on run if it has been 7 days since last check) and then if you are, type radar:help to open the issues page on GitHub and then open an issue there. Alternatively complain in this thread.
  18. Thanks for the report. I can replicate the behavior but it's not so clear how to fix it. It would probably require some sort of AppleScript to be inserted just before the result block but I don't know if I can check if the contact/number is already open or not. I'll investigate more into the matter.
  19. Basically the title. Probably something possible with AppleScript but I hate working with AppleScript if I can help it.
  20. Very useful but outputting json like that doesn't appear to change the env variables that are stored. For most workflow variables this is fine but for some that don't need to be updated every call you need persistent storage. To do that I have been (in python) doing: import plistlib as pl bar = new_variable_content temp = pl.readPlist('info.plist') temp['variables']['foo'] = bar pl.writePlist(temp,'info.plist')
  21. All that should happen when you type im Tonya or use a phone number is it should open Messages with a message to Tonya in focus. If messages doesn't open then typing the message and hitting enter will do nothing. Out of curiosity, what happens if you route the immediate output of the bottom triggers (just before the save initial query block but after the applescript block) to a "Display Big Type" output? If nothing displays it's very broken indeed. It should display the number but all the formatting should be there. If that works then check the output at the "saved cleaned query" step. I currently am unable to make it not do anything on my computer and until I can replicate the error I'm afraid I won't be much help.
  22. The standard file filter does not allow for custom xml in results. Is there a way to replicate its functionality with script filters without compromising speed too much?
  23. The proper usage is in **A**. Numbers must be formatted with 10 or 11 digits as per US rules but it's easily changed to suit your region. If you type im 1234567890 or im 12345678901 or sms 1234567890 or sms 12345678901 or assuming Franz Schubert is in your contacts and has a number containing 10 or 11 digits once other characters are removed, sms Franz Schubert or im Franz Schubert It should work. I don't know why no error message appeared though. I might make it possible to set your area code/region in the future and then it will prepend your area code when texting if it's not present in the number and it could also adjust standard number length by region based on that area code and country code stored in environmental variables. That will have to wait for the next version though.
  24. It was designed for use in the US but it should be easy to change for other countries. The two yellow magnifying glasses check length. The top one checks for numbers of length 7 (xxx-xxxx) plus an optional 3 or 4 digits in front for country codes (+x-(xxx)-..., (xxx)-....). The for text messages area codes are required in the US so it only checks that numbers are 10 or 11 digits long. (+x-(xxx)-xxx-xxxx or (xxx)-xxx-xxxx). You should be able to modify the parts in the brackets to make it work for Czech numbers or anywhere else in the world. Another option is to just by pass the error checking and send the number directly to the scripts at the end after the uncolored magnifying glasses. If an improper number is dialed facetime will pop up or if you try to text it you will get a failed to send message.
  25. I was unhappy with the Alfred support for Continuity/Handoff calling via iPhone so I created this. It integrates with contacts. Use commands call [contact name or arbitrary number] and sms [contact name or arbitrary number] to make it work. 'im' is an alias of 'sms'. New in version 2 Faster than before Supports entering in numeric numbers also Now has primitive error checking. You should see the Facetime application pop up less. More hack-able FIXED: If Contacts isn't open when the command is invoked it will now close itself afterwards. Requires Alfred 3. Download from Github. Download from Packal.
×
×
  • Create New...