how to make alias of multiple files at once ???

Is there a way in unix to make an alias to all the files in a particular folder at once ?

A more advances task would be to make alias to all files in a folder and the folders sub-folders with the extension .MP3. Is there a way to do that ?

iMac, 2 GHz Duo, 1 GB RAM, 256 MB VRAM, Mac OS X (10.4.6)

Posted on May 19, 2006 8:27 PM

Reply
11 replies

May 20, 2006 1:58 AM in response to Detlef Schmitt

>A more advances task would be to make alias to all files in a folder and the folders sub-folders with the extension .MP3. Is there a way to do that ?

You can do this via find:

find /path/to/original/dir -name "*.mp3" -exec ln -s {} /path/to/alias/dir/ \;


This will search for all files that match *.mp3 in the directory /path/to/original/dir and for each match it will execute the ln command (where {} is replaced by the path to the found item).

May 20, 2006 9:23 AM in response to Detlef Schmitt

Hi Detlef,
Yes, as far as I know real aliases can only be created with AppleScript. However, one of the cleverest things Apple did was to arrange for hooks between AppleScripts and shell scripts. Thus you can still use Camelot's excellent find command to batch create aliases, like so:

find /path/to/original/dir -name "*.mp3" -exec osascript -e 'tell application "Finder" to make alias file at POSIX file "/path/to/alias/dir" to POSIX file "'{}\" \;

I've tested the above command and it works but I've only tested is with absolute paths in all places. I would guess that AppleScript's "POSIX file" can only deal with absolute paths so I recommend that you also use only absolute paths if you use this command.
--
Gary
~~~~
Adding sound to movies would be like putting lipstick on
the Venus de Milo.
-- actress Mary Pickford, 1925

May 20, 2006 5:30 PM in response to Gary Kerbaugh

It is where I

a) used a mac IIe or whatever it was called.

b) Learned my first "real" operating system: VMS

c) Used an Evans and Southerland that costs probably $150K in 1980s dollars to do graphics display

d) Used SGI indigo IIs when they became the thing to have, developing my distaste for Irix at an early age.

e) Had to use Unicos on a Cray.

f) Digitized xray films on a scanner hooked up to a VAX PDP11

g) Learned to write some really bad fortran

h) Stored data on reel-to-reel tapes bigger in diameter than frisbees

i) Watched a 3 day riot over a volleyball court


(Berkeley)

May 20, 2006 7:22 PM in response to Bill Scott

Hi Bill,
Interesting! In undergrad school I took an intro CS course in which we submitted our programs on punch cards. Possibly as a consequence it wasn't until the PowerPC came out that I did much else with computers.

In Differential Geometry, Berkeley and Stony Brook were two of the top three schools in the world. (all roughly equivalent) Stony Brook stole my advisor from Berkeley shortly after I got there. We didn't have any riots but the Gucci Fireworks factory blew up while I was there.
--
Gary
~~~~
In the first place, God made idiots; this was for
practice; then he made school boards.
-- Mark Twain

May 21, 2006 4:09 AM in response to Gary Kerbaugh

Yes it's true, Bill and I went to grad school together. I still remember the day when Sung-Hou, his graduate adviser rolled out the red carpet after Bill solved the catalytic RNA structure as a PostDoc in England in the most brilliant and simple way beating Sung-Hou by miles.

Regarding the alias problem. I used an Applescript first. I gave up on it because the script didn't do well with the large number of files that I wanted to create aliases for (~70,000). The speed by which aliases were created started out high but slowed significantly after about 1000 aliases and the script finally timed out after about 15,000 aliases.

I then found a Contextual Menu Items that does the job superbly. It's called QuickAccessCM.
http://www.versiontracker.com/dyn/moreinfo/macosx/16169

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to make alias of multiple files at once ???

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.