AppleScript - Using File Comments to Create New Folder

From your noodle to other noodles. Talk about ways to get the most from Hazel. Even exchange recipes for the cool rules you've thought up. DO NOT POST YOUR QUESTIONS HERE.

Moderators: Mr_Noodle, Moderators

For this one, you'll need the TextCommands osax. Download TextCommands.

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
Posts: 57
Joined: Sun Jan 07, 2007 5:43 am

Return to Tips & Tricks - DO NOT POST QUESTIONS