AppleScript - Using File Comments to Create New Folder

For this one, you'll need the TextCommands osax. Download TextCommands.
Change the folder and path names as needed, of course.
Change the folder and path names as needed, of course.
- Code: Select all
my hazelProcessFile(leFiche)
on hazelProcessFile(leFiche)
tell application "Finder"
set leComments to comment of (leFiche as alias)
end tell
tell application "TextCommands"
set dossierNom to strip (first word of leComments) removing "&project_" from left end
end tell
tell application "Finder"
set leDestination to make new folder at folder "What" of (path to documents folder) with properties {name:dossierNom}
move leFiche to leDestination
end tell
end hazelProcessFile