Multithreading in ApplwscriptObjc

Hi guys I have this app where it should watch a folder and move files/subfolders from it periodically,I want it to run in the background but for now, it blocks the app until it finishes the task, how can I make it run in BG?and is it possible to get a notification when a new item is in the folder I am watching, instead of checking constantly in a loop here ismy code

Applescript:

property watcher : missing value

â€¢ And implement this delegate handler which is called when the directory contents change. Instead of the log command add your logic to move the files. The handler will also be called when items are removed so the check for empty directory is very important.

Re: Multithreading in ApplwscriptObjc

Hi Stefan, I have no idea what have you done in objective c, I have done what you told me and now I have 2 errors in my code and I don't know how to fix them, I never wrote anything in objectve c the first error in .h file says "FSEDirectoryWatcher.h:9:8: Expected "FILENAME" or <FILENAME>"

the second one in the .m file says: "FSEDirectoryWatcher.m:21:1: Cannot synthesize weak property in file using manual reference counting"

Re: Multithreading in ApplwscriptObjc

Darn, as I wrote in the caution line, text in < > is ignored, the first line in the .h file is

Applescript:

#import <Foundation/Foundation.h>

To fix the second error select the project file in the navigator, then click on the target icon. In Build Settings type count in the search field and set Objective-C Automatic Reference Counting to Yes