AppleScript: Watching a folder
The command you're using, "on adding folder item", is specific to folder actions, so it won't work in a non-folder action script. I agree with the others that a folder action is the best way to handle it, but if you really want to do it without, you can create a stay open application that queries the contents of the folder and compares it to the last time it ran, and displays the different files. Change the runInterval property to run at your preferred frequency.
Note: For simplicity, I only wrote it to check for files added to the spool folder. You can tweak it to also check for removed files by duplicating the second section in the code below, and looping through spoolFiles and seeing if they are in currentFiles.
AppleScript Code, as a stay-open application, below:
property spoolFiles : {}
property currentFiles : {}
property runInterval : 5 -- interval is in seconds
global folderSpool
on idle
tell application "Finder"
set folderSpool to folder "Spool" of desktop
if (count of spoolFiles) is 0 then set spoolFiles to name of every file of folderSpool
set currentFiles to name of every file of folderSpool
end tell
set changedFiles to {}--Reverse and repeat this section to check for missing files
repeat with i from 1 to count of currentFiles
if currentFiles's item i is not in spoolFiles then
set changedFiles's end to currentFiles's item i
end if
end repeat
repeat with each_file in changedFiles
set theDialogText to "File is: " & (each_file) & "."
display dialog theDialogText
end repeat
set spoolFiles to currentFiles --important to update the spoolFiles so only new files will get displayed going forward.
return runInterval
end idle