[OT] automator ln to specified folder

Mike Bonner bonnmike at gmail.com
Fri Apr 15 10:34:49 EDT 2016


Got it working here.  First item in the automator app is "Get Specified
Finder Items"  Then the shell script, I'm using

for f in "$@"
do
ln "$f" "/Users/bonnmike/Desktop/myfolder/Plink-$(basename "$f")"
done


Its working both ways actually.  Setting the directory first then running
the loop, or including a full path as part of the ln command. For the shell
script, make sure that "pass input" is set to "as arguments"  for it to
work. It seems to randomly decide to change back to stdin sometimes when
making changes, I've yet to figure out why.

The only other thing you may have to do is filter your results first to
remove any directories from the list and only process files.

On Thu, Apr 14, 2016 at 9:58 PM, Mike Bonner <bonnmike at gmail.com> wrote:

> OH, and the alternative option listed..
>
> ln "$f" "/Users/colin/myfolder/Plink-$(basename "$f")"
>
> is worth a try if you didn't already.
>
> On Thu, Apr 14, 2016 at 9:56 PM, Mike Bonner <bonnmike at gmail.com> wrote:
>
>> Hmm.  I'll get my mac up and going in the morning and try a few things.
>> Another thought.  Complete the creation of links then mv them to the target
>> directory?  I also assume the lack of space after cd is just a typo.
>>
>> On Thu, Apr 14, 2016 at 9:53 PM, Colin Holgate <colinholgate at gmail.com>
>> wrote:
>>
>>> Thanks, that looked hopeful, but with this:
>>>
>>> cd/Users/colin/myfolder
>>> for f in "$@"
>>> do
>>>         ln "$f" "Plink-$(basename "$f")"
>>> done
>>>
>>> I still puts the links in the original folders.
>>>
>>> I trie this too:
>>>
>>>
>>> for f in "$@"
>>> do
>>>         cd/Users/colin/myfolder
>>>         ln "$f" "Plink-$(basename "$f")"
>>> done
>>>
>>>
>>>
>>> > On Apr 14, 2016, at 11:18 PM, Mike Bonner <bonnmike at gmail.com> wrote:
>>> >
>>> >  "Plink-$(basename "$f")"
>>>
>>> _______________________________________________
>>> 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