AppleScript Watched Folders

Download This Script: AppleScript Watched Folder Script

on adding folder items to this_folder after receiving added_items
    try
       repeat with EachItem in added_items
          set ItemInfo to info for EachItem
          if not folder of ItemInfo then
             set FileExtensionOfItem to name extension of ItemInfo
             if FileExtensionOfItem is "xml" then
                tell application "Endicia"
                   process XML file at (POSIX path of EachItem)
                end tell
             end if
          end if
       end repeat
    end try
end adding folder items to

Save this script to the Folder Actions Scripts folder in the Scripts folder.

Then create the folder you'd like Endicia for Mac to watch. Control-click on it to bring up a contextual menu where you can enable folder actions and then attach the above script to the folder.

Save a valid XML file (sample) to the folder and Endicia for Mac will automatically process it. You may want to turn on the renaming of processed XML files preference which will change the extension to .BAK after the file has been processed.