Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by shmulvad

  1. @PHlllPP You can change the renaming logic in the file tiny_upload.py in the function get_new_and_bak_file() to suit your needs. But your changes will be overwritten when the workflow is updated next time so it is not recommended.
  2. @PHlllPP You need to edit the workflow variables. Click the button that looks like [x]. As for your other question, I don’t really see that the benefit in allowing multiple ways of handling renaming originals would outweight the additional mental burden. I would need some convincing arguments to do this.
  3. @Geoffrey I've released version 1.0.2 where the issue regarding bundling of the requests library is fixed and now you can also set a workflow variable KEEP_BACKUPS to either True or False (True per default) that determines whether or not to keep the .bak files.
  4. @dsrjarman, I've added a new option for toggling that accomplishes what you ask for in v1.1.1. Be aware that Alfred strips away the hotkeys from workflows you download, so after downloading it you'll need to set the hotkey (once).
  5. Thanks for making me aware of the unbundled library. Good to hear you got it solved for now, but as deanishe says the proper solution is for it to be bundled. I am busy with exams at the moment but will try to release a new version where this is fixed soon. I will probably look into your other suggestion as well, but no promises on when.
  6. It is just the installation I use per default on my personal system if I do not set up a new separate environment for a Python project. I wrote the workflow because I personally had a use case for it and afterward thought I might as well release it publicly now that the workflow existed anyway. When I tried using just "python" from within Alfred to call it, it didn't work on my system (even though "python --version" gives me 3.8.5 in a regular terminal session, even when no conda env is activated). It could be fixed by using the absolute path, so I just did that. I can see it also works (on my system at least) when using "python3" which I agree would have been a better choice as the default.
  7. Hi Dan. Sorry, but I do not have a M1 machine to test on. I am not sure what causes the issue based on your information, but since at least some of the workflow works based on your information, I think it is not a problem with your Python version and something else is causing it. Can you check the log using the Workflow Debugger and report back on what you see?
  8. I've added the code to remove the quarantine flag as suggested by @vitor. However, before I did this, I didn't seem to get the warning myself when I deleted the binary and then added it as a new freshly downloaded one. So I'm not sure whether or not this fixes it.
  9. Nice to hear that you like it, DanP! I don't know how to not have that message show up. If someone more experienced in macOS development here on the forum can me tell how to accomplish it (without having to buy an Apple Developer account), I'll be happy to implement it.
  10. Sorry about that. This workflow uses Python 3. Does it work if you do "which python3" in your Terminal and set that as the path for the variable "pythonPath" in the workflow?
  11. An Alfred 4 workflow for quickly compressing and resizing images using TinyPNG. Simply select a collection of images or a folder in Finder and activate the workflow. Installation and Getting Started Install alfred-tinypng workflow. All further updates are handled automatically. You will need to configure the workflow with an API key from TinyPNG. Type tinypng_api to get a link to the pagewhere you can get your API key and to actually set the key when you have gotten it. Usage Select either a folder, image file or a number of image files in Finder. Afterward, open Alfred and type tinypng. You are presented with the following choices: Choose an item based on what you want. When selected, the workflow will start compressing/resizing the image(s). After it is done, they will be saved to the same directory and with the same filename as the original image. The original image will be preserved with .bak prepended before the file extension. I.e. if compressing img.jpg, this will now become img.bak.jpg and the compressed image will be saved as img.jpg. Refer to the TinyPNG documentation for a full explanation of the different resizing options. Why? Another TinyPNG workflow already exists It doesn't support choosing the files based on what is selected in Finder (which I personally prefer). Only simple compression is supported whereas all TinyPNG compressions and resizing options are supported in this workflow. It seems to be abandoned by the creator (has not been updated since 2015). Credits The workflow makes use of the following: OneUpdater by vitorgalvao for handling automatic updates. TinyPNG Python API Code and more can be viewed on the associated GitHub-repo. If you find this workflow useful, stars are appreciated.
  12. Thank you for the workflow, it is very useful! Just a note about automatic updates: When you're hosting the package on Github anyway there is a ready made solution that requires almost nothing of you, meaning you can easily add this feature to your workflow. Check out https://github.com/vitorgalvao/alfred-workflows/tree/master/OneUpdater
  13. I don't know if you're still active on this forum, but if so, I've just released a workflow that can quickly turn off/on Night Shift:
  14. NightShift Quickly turn on/off Night Shift or set it to a custom value between 0 - 100. Installation To download, visit the latest release at GitHub. All further updates are handled automatically. Description Quickly turn on/off Night Shift or set it to a value between 0-100. No more fiddling with deep settings when you either want to save your eyes or need to work with accurate colors! In Alfred, type night followed by either off, on or a number between 0 - 100. Credits The workflow makes use of the following: nshift by leberwurstsaft as the backend for setting the values. OneUpdater by vitorgalvao for handling automatic updates.
  15. Okay, I didn't know that - thanks for letting me know! The workflow is now updated to use JSON. I'll agree with you, that is much cleaner.
  16. Roman Numeral Converter Convert between roman numerals and arabic integers Installation To download, visit the latest release at GitHub. All further updates are handled automatically. Description This is a fairly simple workflow for converting between roman numerals and arabic integers. This has been made before by Tyler Eich (Packal link), but hasn't been updated since 2015 and stopped working on my computer during an Alfred or macOS update (can't remember which). But I had an use case for this, and therefore I made a new version written in Python for this simple task. In Alfred, type rn and enter either your roman numeral or arabic integer. Selected result is copied to your clipboard. The expression is being evaluated as you type it. If the expression cannot be evaluated, for example if you are using illegal characters, user will be notified about that. Note The workflow doesn't support incorrectly written roman numerals, i.e. "IC", and will also notify user about this: Credits The workflow makes use of the following code to focus on the implementation of the conversion between the number systems rather than focusing on a lot of Alfred Workflow related stuff. OneUpdater to easily check for updates by vitorgalvao. Alfred Workflow Feedback XML Generation to easily add items by lrrfantasy.
  17. After first reinstalling the workflow and then restarting my Mac it now works again. I am (and was) using macOS 10.14.1 and Alfred v. 3.7. Sorry for not trying this out before commenting.
  18. This workflow seems to not work for me anymore. Maybe it happened during the update to Mojave. Anyway, I was wondering if anyone knows of a nice workflow that accomplishes the same thing as this?
  19. I really wanted the feature I describe above, so I went ahead and modified the code to achieve this behaviour. I don't have any experience with Perl, so I guess the stuff I have rewritten is pretty poorly written code, but for now it works. This is what is now shown when the workflow is called with an expression that can be evaluated: And this is what it looks like when you insert an expression that can't be evaluated: I have forked the original repo and made a pull request. For now, the modified workflow can be downloaded from here,
  20. I really find this workflow useful and have been using it a lot. Would it be possible to add to it, so that instead of having to press a modifier key to copy different results other than binary and then view them, the result in both decimal, hex, binary and octal is immediately printed to the screen as four separate items in Alfred? And then copying a result is just done by selecting the corresponding item?
  21. Hey I'm trying to make an AppleScript to be run from Alfred, that should quickly set a specified speaker as audio output device if it is currently connected (in example below "My Awesome Speaker"), and otherwise don't do anything. I have gotten most of the functionality down (toggling between speaker/internal speaker), but I'm having a problem in the instance that the speaker isn't connected. When this is the case, the script has already clicked on the audioMenu, making the dropdown be there until a mouse click. I thought I could make it go away by branching with an "if else" and then if the speaker isn't connected, then just clicking the audioMenu again (because I've seen similar behaviour (with succes) for other menu bar scripts). But if I instead do this, the audio dropdown will still be staying until a click has been made, and then the script clicks the audio icon again making it doubly annoying. on alfred_script(q) set speakerName to "My Awesome Speaker" set internalSpeakers to "Internal Speakers" activate application "SystemUIServer" tell application "System Events" tell process "SystemUIServer" -- Working CONNECT Script. Goes through the following: -- Clicks on Audio Menu (OSX Top Menu Bar) -- Clicks your speaker if not connected -- Else if connected, then disconnects by clicking Internal Speakers set audioMenu to menu bar item 4 of menu bar 1 tell audioMenu click if exists menu item speakerName of menu 1 then set speakerMenuItem to menu item speakerName of menu 1 if value of attribute "AXMenuItemMarkChar" of speakerMenuItem is "✓" then click menu item internalSpeakers of menu 1 return "Disconnecting from " & speakerName & "..." else click speakerMenuItem return "Connecting to " & speakerName & "..." end if else -- Doesn't work for now. Just clicks it again after you deselect menu, making it double annoying --click audioMenu return "Doesn't look like you're connected to " & speakerName & "..." end if end tell end tell end tell end alfred_script How can I fix this, so the dropdown actually goes away if speaker is not connected?
  • Create New...