Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Creating an Alias Catalog - can Automator do it?

Hi all,


I've been searching the interweb tubes without much success... so any help is appreciated!


Q: Is it possible to duplicate the hierarchical folder structure of a removable disc and populate it with alias files of the originals?


I used to use a neat little program called AutoCat that would read the contents of a DVD or CD and create a duplicate folder structure containing alias files of the originals. I find it's an ideal quick reference for archived discs (and works with Spotlight too).


Anyway, as AutoCat is no longer being developed and doesn't support Lion, I've been looking for an equivalent (without any luck).


So, I rolled up my sleeves and turned to Automator.


To date, I've only been able to create a process that makes aliases of an entire disc in an existing specified folder:


Application > Files&Folders > Get Folder Contents (tick repeat for subfolders) > New Aliases (specify a destination folder)


Unfortuantely that 'flattens' the directory structure, so no aliases are contained in actual sub folders, it's just one big mess (not that useful when there are a lot of similarly named files that should be separated into specific folders).


I've tried various methods using things like "Filter Finder Items where Kind is folder" with the intention of just trying to duplicate the folder hierarchy but without much success.


I'm guessing AppleScript is more powerful, but that's a whole new scary ballgame!


Can anyone suggest a better Automator sequence, or point me in the direction of a suitable AppleScript that I can attempt to understand?


Many thanks - if anything needs explaining a bit better let me know.

Mac Pro, Mac OS X (10.7.2)

Posted on Nov 9, 2011 9:49 AM

Reply
Question marked as Best reply

Posted on Nov 15, 2011 1:50 AM

Hi


Just in case anyone ever stumbles across this thread, I thought I'd post a solution.


Many thanks to all those AppleScripters who had posted their work online for me to read through. I eventually managed to adapt a few scripts to make this thing work:


on run

set SourceFolder to choose folder with prompt "Select items to be catalogued:" as string

my MainScript(SourceFolder)

end run


on open of SourceFolderList

repeat with ThisFolder in the SourceFolderList

set ThisFolderPath to ThisFolder as string

if last character of ThisFolderPath is ":" then

my MainScript(ThisFolderPath)

end if

end repeat

end open


on MainScript(SourceFolder)

tell application "Finder"

set SourceFolder to folder (SourceFolder)

set the TargetFolder to ("HD:Path:To:TargetFolder:" as alias)

end tell


if SourceFolder is not "" and TargetFolder is not "" then

set NewFolderName to (name of SourceFolder as string)

set CreatedFolder to CreateNewFolder(TargetFolder, NewFolderName)

my DuplicateFolderStructure(SourceFolder, CreatedFolder)

end if

end MainScript


on DuplicateFolderStructure(SourceFolder, TargetFolder)

tell application "Finder"

try

set NewAliases to every file of SourceFolder


makenewalias fileatTargetFoldertoNewAliases


set FolderList to every folder of SourceFolder

repeat with ThisFolder in the FolderList

set CreatedFolder to my CreateNewFolder(TargetFolder, get name of ThisFolder)

my DuplicateFolderStructure(ThisFolder, CreatedFolder)

end repeat

end try

end tell

end DuplicateFolderStructure


on CreateNewFolder(TargetFolder, NewFolderName)

tell application "Finder"

try

set NewFolder to makenewfolderatTargetFolderwith properties {name:NewFolderName}

return NewFolder

on error ErrorMsg


display dialogErrorMsg

end try

end tell

end CreateNewFolder

3 replies
Question marked as Best reply

Nov 15, 2011 1:50 AM in response to FlumpX

Hi


Just in case anyone ever stumbles across this thread, I thought I'd post a solution.


Many thanks to all those AppleScripters who had posted their work online for me to read through. I eventually managed to adapt a few scripts to make this thing work:


on run

set SourceFolder to choose folder with prompt "Select items to be catalogued:" as string

my MainScript(SourceFolder)

end run


on open of SourceFolderList

repeat with ThisFolder in the SourceFolderList

set ThisFolderPath to ThisFolder as string

if last character of ThisFolderPath is ":" then

my MainScript(ThisFolderPath)

end if

end repeat

end open


on MainScript(SourceFolder)

tell application "Finder"

set SourceFolder to folder (SourceFolder)

set the TargetFolder to ("HD:Path:To:TargetFolder:" as alias)

end tell


if SourceFolder is not "" and TargetFolder is not "" then

set NewFolderName to (name of SourceFolder as string)

set CreatedFolder to CreateNewFolder(TargetFolder, NewFolderName)

my DuplicateFolderStructure(SourceFolder, CreatedFolder)

end if

end MainScript


on DuplicateFolderStructure(SourceFolder, TargetFolder)

tell application "Finder"

try

set NewAliases to every file of SourceFolder


makenewalias fileatTargetFoldertoNewAliases


set FolderList to every folder of SourceFolder

repeat with ThisFolder in the FolderList

set CreatedFolder to my CreateNewFolder(TargetFolder, get name of ThisFolder)

my DuplicateFolderStructure(ThisFolder, CreatedFolder)

end repeat

end try

end tell

end DuplicateFolderStructure


on CreateNewFolder(TargetFolder, NewFolderName)

tell application "Finder"

try

set NewFolder to makenewfolderatTargetFolderwith properties {name:NewFolderName}

return NewFolder

on error ErrorMsg


display dialogErrorMsg

end try

end tell

end CreateNewFolder

Jun 19, 2012 6:11 AM in response to FlumpX

I tried the Applescript and while it works, it's very, very slow and the resulting folder was over 2 gig in size. AutoCat's folders for the same number of items were typically around 150 meg.


The good news is that I found another very fast utility that does work under Lion called Touvaly. The catalog results folder with over 33,000 items is only 16kb in size versus the aforementioned 150 meg for AutoCat!


The url is:


http://www.limit-point.com/Touvaly/Touvaly.html

Creating an Alias Catalog - can Automator do it?

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