I have a folder action that works “on adding folder items”. But the same folder is a hot folder for some program, so it’s checked from time to time. When it’s checked - something named “probe” appears for a second in a folder (I even don’t know, is it some kind of a file, or what?). So my folder action reacts on it and try to do what it suppose to do with a files - and I get an error, because this “probe” thing disappears.
Does anybody know what may be done?
Any help will be greatly appreciated!
Thank you in advance
Vera
I posted my question on another forum, and got a solution: I did not know there is workaround in case of error!
Here it is:
on adding folder items to this_folder after receiving these_items
repeat with this_item in these_items
set this_item to this_item’s contents
try
set _ignore to (info for this_item)'s name = “probe”
on error number -43 – File or directory not found; in case this_item has been already deleted
set _ignore to true
end try
if _ignore then
– ignore it
else
– your code for this_item, that is not named ‘probe’, here
end if
end repeat
end adding folder items to
Hope it might be helpful to everybody.
Vera
Hi,
you can do it also this way
on adding folder items to this_folder after receiving these_items
repeat with this_item in these_items
try
if (info for this_item)'s name is not "probe" then
-- do something
end if
end try
end repeat
end adding folder items to