[OT] automator ln to specified folder

Colin Holgate colinholgate at gmail.com
Fri Apr 15 12:12:46 EDT 2016


I get a “no such folder: bonnmike” error…

Just teasing! Thanks for the help, this combination seems to work well. I did remove the PLINK- part, I need the names to stay the same.

For your interest, and others too, the problem this is to solve is a DropBox complexity issue. My designer colleagues upload animation files to DropBox in a structure that is based on the entire application experience. This means there are 65 folders, and up to five levels deep. My tech colleagues use GIT, and have build scripts that work on a less complex folder structure. Using hard links will let me download the set of folders that the designers created, but work on the files in a GIT friendly structure.


> On Apr 15, 2016, at 10:34 AM, Mike Bonner <bonnmike at gmail.com> wrote:
> 
> 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
>>>> 
>>> 
>>> 
>> 
> _______________________________________________
> 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