Sridhar Katakam Posted January 26, 2023 Share Posted January 26, 2023 Hi. I am trying to pass selected file(s)/folder(s) from Alfred's File Search to a custom Shortcut that uses the "Make Archive" action. Shortcut: Workflow: The expectation is that if I select say, a folder in Alfred's file search results and I bring up the action panel and select "Zip" it should generate a zip file having the same name as the folder. Atm, nothing happens. Any help is appreciated. Thanks in advance. Link to comment
Stephen_C Posted January 26, 2023 Share Posted January 26, 2023 What happens if you select files rather than a folder? Is the result the same? Stephen Link to comment
Sridhar Katakam Posted January 26, 2023 Author Share Posted January 26, 2023 3 minutes ago, Stephen_C said: What happens if you select files rather than a folder? Is the result the same? Stephen Just tried. The same result - nothing happens. Link to comment
Stephen_C Posted January 26, 2023 Share Posted January 26, 2023 I've been messing around with a test workflow for some time trying to do what you are trying, without success. However, the Shortcut also doesn't work if I add it as a Quick Action and run it on files as a Quick Action from Finder. It merely then brings up alternative archiving apps but does nothing if one is selected. Sorry that I don't currently have time to pursue this further but maybe this will give you some ideas! Stephen Link to comment
Sridhar Katakam Posted January 26, 2023 Author Share Posted January 26, 2023 14 minutes ago, Stephen_C said: However, the Shortcut also doesn't work if I add it as a Quick Action and run it on files as a Quick Action from Finder. You are right. I updated the Shortcut like this and now it works when invoked via a Quick Action in Finder: It does not still work via the Alfred workflow though. Alan He 1 Link to comment
Stephen_C Posted January 26, 2023 Share Posted January 26, 2023 I agree on both counts: your variation works as a Quick Action but doesn't appear to work when the Shortcut is linked from Alfred. Sorry not to be more help just at the moment! Stephen Link to comment
Stephen_C Posted January 26, 2023 Share Posted January 26, 2023 @Sridhar Katakamthis seems to work: I ran it as a Universal Action but no doubt it will work as a File Action. Stephen Link to comment
Sridhar Katakam Posted January 26, 2023 Author Share Posted January 26, 2023 (edited) @Stephen_C Turns out this is possible w/o using the Shortcuts app. Changed the settings of the built-in Archive Utility to output zip files and then used the "Open File" action of Alfred. Edited January 26, 2023 by Sridhar Katakam Stephen_C 1 Link to comment
Stephen_C Posted January 26, 2023 Share Posted January 26, 2023 9 minutes ago, Sridhar Katakam said: Turns out this is possible w/o using the Shortcuts app My only observation on that is that if I choose multiple files each is compressed to an individual .zip archive rather than combining all in one compressed archive. Stephen Link to comment
Sridhar Katakam Posted January 26, 2023 Author Share Posted January 26, 2023 You are right. The proper way would be running a bash script along the lines of ``` ditto -c -k --sequesterRsrc --keepParent "$@" "$(dirname "$1")/Archive.zip" ``` but I'd like the zip file's name to be the file/folder name if the input is a single file/folder and "Archive.zip" if the input has more than 1 item. Not sure how to code that part. In the meantime, I've installed the free Keka app and it does the job. Link to comment
Stephen_C Posted January 26, 2023 Share Posted January 26, 2023 I shall stick with the Shortcut solution because I've set up the Shortcut to prompt me for the archive name so can choose it in each case. Stephen Sridhar Katakam 1 Link to comment
Babylon Posted January 26, 2023 Share Posted January 26, 2023 (edited) On 1/26/2023 at 12:28 PM, Sridhar Katakam said: You are right. The proper way would be to use the odds calculator of wetten.com and using a bash script along the lines of ``` ditto -c -k --sequesterRsrc --keepParent "$@" "$(dirname "$1")/Archive.zip" ``` but I'd like the zip file's name to be the file/folder name if the input is a single file/folder and "Archive.zip" if the input has more than 1 item. Not sure how to code that part. In the meantime, I've installed the free Keka app and it does the job. I use the Keka app too and am satisfied with it. So for all people who have a similar problem and need a fast and easy solution I recommend the app. Edited January 27, 2023 by Babylon Alan He 1 Link to comment
Alan He Posted January 26, 2023 Share Posted January 26, 2023 I think not need any workflow. just use trigger universal action - open with and select zip app, for example keka. Link to comment
Stephen_C Posted January 26, 2023 Share Posted January 26, 2023 2 hours ago, Alan He said: I think not need any workflow. You are, of course, right…unless people don't wish to use a third party app and choose instead to rely on the inbuilt Archive Utility App. Stephen Link to comment
Sridhar Katakam Posted January 26, 2023 Author Share Posted January 26, 2023 8 hours ago, Alan He said: I think not need any workflow. Sure but in my case, I wanted to be able to type "zip" and hit return in the actions menu. Link to comment
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