Reputation: 65
I'm currently using the split command to split a large file into many 50MB files. For example:
split -b50m filename.ext filename.ext.
This works really well, but I'd like to use Automator to create an application that I can give to a friend who is less familiar with the command line.
I realise that there are existing applications which can handle this (e.g. Split&Concat), but I want to use this as an opportunity to learn about Automator. This is what I would like to achieve:
How do I pass the file name to the command line?
Upvotes: 2
Views: 2533
Reputation: 4843
When you save the Automator script as an Application the dropped file is passed to the first action automatically.
Select the Run Shell Script pass the input in as an arguments and access it using $@
.
You can use the above split
command instead. The following Automator takes the input file and moves it to the ~/Desktop/haha
folder.
Upvotes: 3