|May 7, 2005, 06:13 PM||#1|
Consolidating files with applescript
I have tons of files in a bunch of subdirectories within a main directory. I'd like to preserve this hierarchy, but would also like to have access to these files in one chunk as aliases in another folder. Would this be possible with applescript? And if so, what would be the best way to go about it?
EDIT: Also, would it be possible to have this folder of aliases dynamically update after running the script by itself?
Last edited by iostream.h; May 7, 2005 at 06:33 PM.
|May 7, 2005, 10:21 PM||#2|
You could use this script to create the initial aliases:
tell application "Finder" --Get source and destination folders set sourceFolder to choose folder with prompt "Please choose a source folder for the files" set destinationFolder to choose folder with prompt "Please choose a destination folder for the aliases" set theItems to every item of sourceFolder --Iterate through the items in sourceFolder repeat set nextItem to first item of theItems --First check that the item is not destinationFolder so that we don't make aliases of the aliases if (nextItem as string is not destinationFolder as string) then if ((class of nextItem) is folder) then --The item is a folder, so add its files to the end of the array set theItems to theItems & every item of nextItem else --The item is a file, so make an alias of it in destinationFolder tell application "Finder" to make alias to nextItem at destinationFolder end if end if --Remove the item from the array, or exit from the loop if it's the last item if ((count of theItems) is 1) then exit repeat else set theItems to items 2 thru (count of theItems) of theItems end if end repeat display dialog "Finished created aliases" buttons "OK" default button 1 with icon 1 end tell
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Copy files to folder using Applescript||Kitkat88||Mac Programming||7||Jun 23, 2014 07:45 AM|
|Consolidating numerous files, same artist.||CaptKatmai||iPod||0||Apr 29, 2014 08:14 PM|
|Applescript moving files issue||Liquid80||Mac Programming||2||Oct 2, 2013 11:29 PM|
|iTunes consolidating movie files||MoodyM||Mac Applications and Mac App Store||0||Aug 24, 2013 10:19 AM|
|consolidating all my photo files||jlirot||Digital Photography||16||Aug 22, 2013 12:15 PM|
All times are GMT -5. The time now is 01:59 PM.