BenjaminO Posted December 27, 2022 Share Posted December 27, 2022 (edited) Hello, i'd like to share a workflow I made myself recently This workflow allows you to transform your images into WebP format with ease Here is the GitHub repo with a complete documentation Edited April 5 by BenjaminO Link to comment Share on other sites More sharing options...
vitor Posted December 29, 2022 Share Posted December 29, 2022 Instead of asking users to edit the keyword, make it editable: Add a new Keyword configuration and set it in the workflow as {var:whatever_name} (this is explained in the linked page). Why isn’t the presets and logs folder also defaulting to the workflow’s data folder, like the documentation folder? Setting an images folder in the configuration seems more cumbersome than it needs be. It’s fine to have it as an option, but a File Action Trigger should be available too. A File Filter Input could connect to the same place too. Tangentially, for it to not be optional (but it should be) you should set it as required in the configuration’s backend instead of (or in addition to) mentioning it in the documentation. The submission is also missing a listing of the required dependencies. Plus, in the workflow you’re installing extra software on the user’s behalf, which should not happen. Alfred itself can install Homebrew and dependencies from there. Seems like you’re installing perl modules too? Link to comment Share on other sites More sharing options...
BenjaminO Posted December 30, 2022 Author Share Posted December 30, 2022 Hello @vitor, Thank you for your feedback ! Regarding the first two points, you're right, I'll put a configuration for the trigger and merge the two folder, it will be less confusing. in addition, I'll remove the possibility to install extra dependency within the workflow. To be honest I didn't know that Alfred could install brew and perl packages by itself. The list of dependencies is shown in the workflow and in the documentation: Homebrew -> to install webp, jq and cpanm webp -> to compress images jq -> to manipulate json data cpanm -> to install mojo mojolicious -> perl dependency to scrape cwebp documentation However, I don't understand your third point. For me it is easier to target a folder using file filter (in the workflow) and save it as a "config variable". I remarked that env variable aren't working when I was using the configuration. This value is intentionally optional because the workflow can't be triggered if a value is not set up (when required) which is not what I want as it is more practical to configure it within the workflow ! Same for the preset. Lastly, could you explain this : 13 hours ago, vitor said: The submission is also missing a listing of the required dependencies Many thanks in advance ! Link to comment Share on other sites More sharing options...
vitor Posted December 30, 2022 Share Posted December 30, 2022 4 hours ago, BenjaminO said: To be honest I didn't know that Alfred could install brew and perl packages by itself. Not the Perl packages, it is extremely rare to see a Workflow needing that. Why require a web framework anyway? If it’s for the documentation, it’s definitely too much. It’s OK to include docs, but they shouldn’t require the user to install extra software. At that point, it’s best to send them to a web page. 4 hours ago, BenjaminO said: For me it is easier to target a folder using file filter (in the workflow) and save it as a "config variable". That requires two steps every time you want to compress, one to set the folder and another to compress. There should at least be the option to select and compress in one go, which the File Filter and File Action can do. 4 hours ago, BenjaminO said: I remarked that env variable aren't working when I was using the configuration. I don’t understand this part. 4 hours ago, BenjaminO said: Lastly, could you explain this You’ve done that in your post, it’s the list of software to install. Link to comment Share on other sites More sharing options...
BenjaminO Posted December 30, 2022 Author Share Posted December 30, 2022 (edited) Ok I understand. The offline doc is only there to help new user to copy paste options into their presets. I'll remove the perl script (so no more perl dependency needed) and I'll make the offline doc exportable (txt file in the workflow folder). I am adding a new way to compress images to be more intuitive and straightforward even though I like reviewing my parameters before running the cwebp script 2 hours ago, vitor said: I don’t understand this part. I remarked that when setting User Configuration (text fields, text area...), env variables were not working. I don't know why. That is the reason I put Images folder into User Configuration. EDIT : Do you know what's the short way to access the path of the workflow folder. I only see this way : {const:alfred_preferences}/workflows/{const:alfred_workflow_uid}/ which is not super practical. Edited December 30, 2022 by BenjaminO Link to comment Share on other sites More sharing options...
BenjaminO Posted January 2 Author Share Posted January 2 Hello @vitor, I just updated the workflow with a 2.0 version! Here are the changes made: On 12/29/2022 at 8:23 PM, vitor said: Instead of asking users to edit the keyword, make it editable: Add a new Keyword configuration and set it in the workflow as {var:whatever_name} (this is explained in the linked page). On 12/29/2022 at 8:23 PM, vitor said: Why isn’t the presets and logs folder also defaulting to the workflow’s data folder, like the documentation folder? Presets and logs folder are now located in the the workflow’s data folder by default and can be change in the User Configuration panel. The doc is in the workflow folder (exported). On 12/29/2022 at 8:23 PM, vitor said: Setting an images folder in the configuration seems more cumbersome than it needs be. It’s fine to have it as an option, but a File Action Trigger should be available too. A File Filter Input could connect to the same place too. Tangentially, for it to not be optional (but it should be) you should set it as required in the configuration’s backend instead of (or in addition to) mentioning it in the documentation. No more images folder or preset to select before the compression. Now we can use Universal actions (or regular search files) to select both folders and images at the same time using the buffer to compress everything. There is also the possibility to input manual options instead of presets. On 12/29/2022 at 8:23 PM, vitor said: The submission is also missing a listing of the required dependencies. Plus, in the workflow you’re installing extra software on the user’s behalf, which should not happen. Alfred itself can install Homebrew and dependencies from there. Seems like you’re installing perl modules too? The workflow is no more installing anything. I removed perl dependencies. Only Homebrew, webp (cwebp) and jq are needed. Link to comment Share on other sites More sharing options...
BenjaminO Posted January 6 Author Share Posted January 6 hello @vitor, do you know if the workflow (v2.0) is compliant with Alfred Gallery requirements or should I still need to make changes ? Thank you in advance for your response 😄️ Link to comment Share on other sites More sharing options...
vitor Posted January 7 Share Posted January 7 @BenjaminO It looks like it but will only know for sure during the next review/testing. I do expect other eventual things to be minor and/or addressable via pull request. BenjaminO 1 Link to comment Share on other sites More sharing options...
BenjaminO Posted April 5 Author Share Posted April 5 Hey @vitor, I just want to let you know that I made quite few changes to this workflow. I used JXA to avoid the need of jq dependency. Only cwebp is now required. Link to comment Share on other sites More sharing options...
vitor Posted April 21 Share Posted April 21 Was aiming to get this in this week and it’s live: https://alfred.app/workflows/benjaminoddou/smart-webp/ A couple of suggestions:When managing presets it might be nice to reopen the same window after doing an action. That would allow to, for example, delete all the default ones in a row or quickly add a bunch. Though I get that adding new presets won’t happen all the time so it’s not a big deal, just something I noticed while testing.When making a preset, if we don’t add a subtitle it will show up as undefined. Might be better to just not add it or make it “No description” which at least looks intentional.If a WebP image with the same name exists in the same folder, it is overwritten. It’s your choice if a naming conflict overwrites, or if it gives an error, or names the image differently. Just wanted to make sure you’re aware.It wasn’t clear from the workflow alone what “Depth of the search” does. Calling it “search” might be confusing since it seems related to the File Filter part. Might be worth extending the note to make it clear it pertains to folder conversions, either in the the config itself or the About. Personally I might do without the option entirely, but it’s up to you, you probably have a reason for the choice.I’m not sure it’s worth it to make the data folder configurable. I wonder if anyone will change that. Might be more useful to e.g. provide a keyword to open it fast. Unless you yourself set it to something custom, I see from your workflows that you do like having logs!Again, none of that is a deal breaker (clearly, the workflow was added!) or even something you have to take into account. It’s basically just chatting about functionality since you seem to like stuff well organised. Have a good weekend! BenjaminO 1 Link to comment Share on other sites More sharing options...
BenjaminO Posted April 22 Author Share Posted April 22 Hey Vitor ! Thank you very much for the feedback ! To respond to your suggestions : 12 hours ago, vitor said: When managing presets it might be nice to reopen the same window after doing an action. That would allow to, for example, delete all the default ones in a row or quickly add a bunch. Though I get that adding new presets won’t happen all the time so it’s not a big deal, just something I noticed while testing. It has some tradeoffs so I'll let it like that for now. But maybe I can delete one example of preset to facilitate their suppression. 12 hours ago, vitor said: When making a preset, if we don’t add a subtitle it will show up as undefined. Might be better to just not add it or make it “No description” which at least looks intentional. Indeed ! This will be updated to show "No description" instead of "undefined". 12 hours ago, vitor said: If a WebP image with the same name exists in the same folder, it is overwritten. It’s your choice if a naming conflict overwrites, or if it gives an error, or names the image differently. Just wanted to make sure you’re aware. I am aware of this behavior. I didn't change it yet because I was not sure what was the best strategy to address that. I will probably add a dropdown list that will let user choose if he/she prefers to overwrites/gives error/or name images differently as you suggested. I'll need some time to do it properly. BTW, if anyone wants to contribute, don't hesitate to submit a pull request in the github repo : https://github.com/BenjaminOddou/alfred-smart-webp-compression/pulls . 13 hours ago, vitor said: It wasn’t clear from the workflow alone what “Depth of the search” does. Calling it “search” might be confusing since it seems related to the File Filter part. Might be worth extending the note to make it clear it pertains to folder conversions, either in the the config itself or the About. Personally I might do without the option entirely, but it’s up to you, you probably have a reason for the choice. I am actually using it quite a lot. It allows to compress images in nested folders. I'll update the description in the user configuration panel 13 hours ago, vitor said: I’m not sure it’s worth it to make the data folder configurable. I wonder if anyone will change that. Might be more useful to e.g. provide a keyword to open it fast. Unless you yourself set it to something custom, I see from your workflows that you do like having logs! I set it up to a custom folder myself as I am checking logs manually sometimes. Indeed I like knowing what's going on and sometimes want to check details of cwebp ouput Thank you again for your time and your work ! Have a nice week-end ! Link to comment Share on other sites More sharing options...
vitor Posted April 22 Share Posted April 22 1 hour ago, BenjaminO said: I didn't change it yet because I was not sure what was the best strategy to address that. I will probably add a dropdown list that will let user choose if he/she prefers to overwrites/gives error/or name images differently as you suggested. I feel like this is one of those situations where each user will have a specific mental model the vast majority of the time. Either “I’m super cautious and never want to risk it” or “I know what I’m doing, I only use WebP for these web projects and always keep originals safe”. A checkbox will probably be enough. For reference, that’s how Automation Tasks do it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now