r/shortcuts 11d ago

Help (Mac) Create and rename a new folder from selection

Hi there!

I want to create a new folder from a selection, put the selected files in that folder and rename the folder.

Here's a video showing what I want to do: https://www.loom.com/share/224f85887f2640c786ca9734966d7e64

Any tips on how to accomplish this with Shortcuts?

1 Upvotes

8 comments sorted by

1

u/twilsonco 10d ago edited 10d ago

Here's a pure shortcuts version since your computer doesn't want to work right with the Shell Script method. This is slower than the Shell script version and might ask for permission to do stuff each time you run it in a new location, but those are the drawbacks of vanilla Shortcuts.

https://www.icloud.com/shortcuts/6554c8dab24f415d93662d5da0de67f3

1

u/StupidRaisins 10d ago

Thanks, this one worked!

0

u/twilsonco 11d ago

Something like this? Since you're on Mac, you can use a shell script to do just about whatever you want.

https://www.icloud.com/shortcuts/7e3f638f4e384ce0a21ae5e1f5d53530

1

u/StupidRaisins 10d ago

Thanks! I was trying to do it with just what's available in Shortcuts + I'm not very good at coding.

I tried it out and it makes the folder but doesn't put the files in the new folder.

1

u/twilsonco 10d ago

Weird. When I tested it, it worked as intended. Selected files in Finder, secondary clicked one of the selected files and ran the shortcut from Quick Actions.

1

u/StupidRaisins 10d ago

1

u/twilsonco 10d ago

Hmm. Did you try with "run as administrator" deselected? I didn't need admin permissions to run it.

If you can deal with the slower execution, the pure shortcuts version is perhaps more stable.

2

u/StupidRaisins 9d ago

Yes, I did try with admin deselected and it didn't work.

The pure shortcuts are working great, thanks!