[OT] automator ln to specified folder

Mike Bonner bonnmike at gmail.com
Thu Apr 14 23:18:46 EDT 2016


I assume you've tried the obvious stuff for your automator shell script
call.. cd to the directory first then loop through the dropped files.

cd /my/target/directory

for f in "$@"
do
  ln "$f" "Plink-$(basename "$f")"
done

basename removes path information and returns just the filename portion, so
it should default the link to the current directory.

Alternatively, you could do the same, but add a path inside the quotes
before Plink, but the "basename" would still be necessary of course, while
obviating the need for the cd line.
.

On Thu, Apr 14, 2016 at 8:20 PM, Colin Holgate <colinholgate at gmail.com>
wrote:

>
> I want to drag any number of files (in different folders) on to an
> Automator application that has a Shell script to make a hard link of each
> file into a particular folder. Whatever I’ve tried so far makes the link
> file in the original file’s folder.
>
> Any suggestions on how to set the target directory?
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list