Jump to content

Passing files/folders from Alfred to Shortcuts for making an archive


Recommended Posts

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:

 

image.thumb.png.aca09898ce0289387a89c44776756fd4.png

 

Workflow:

 

image.png.9c5409c2a0d49dc156b861117c2bc7da.png

 

image.thumb.png.70af5409c1cc97594c7c4ad281bb1104.png

 

image.thumb.png.5607ebd23874582dbec4840e27025a2e.png

 

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

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
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

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
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 by Babylon
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...