12-01-2011, 07:04 AM
This AppleScript will display the file type and creator of any file that has one.
This AppleScript will sort files from a folder into sub-folders based upon type.
It should be pretty obvious where to change the types or add new types and folders.
There shouldn't be any problems, but use the script on a copy of the folder just in case.
set my_file to (choose file)
set file_info to info for my_file
display dialogName:& (name of file_info) & & &Type:& (file type of file_info) &Creator:& (file creator of file_info)
This AppleScript will sort files from a folder into sub-folders based upon type.
It should be pretty obvious where to change the types or add new types and folders.
set target_folder to (choose folder)
tell applicationFinder
try
set wrd_folder to (make new folder at target_folder with properties {name:WORD})
set rtf_folder to (make new folder at target_folder with properties {name:RTF})
set email_folder to (make new folder at target_folder with properties {name:
end try
set file_list to (every item of target_folder)
set folder_list to name of every folder of target_folder
set no_items to count of file_list
repeat with i from 1 to no_items
set the_file to item i of file_list as alias
set file_info to info for the_file
if folder_list does not contain (name of file_info) then
if file type of file_info containsdocthen move the_file to folderWORDof target_folder
if file type of file_info containsrtfthen move the_file to folderRTFof target_folder
if file type of file_info containsemlthen move the_file to folder
end if
end repeat
end tell
There shouldn't be any problems, but use the script on a copy of the folder just in case.