When I call a handler from outside another handler it runs fine doing what it is supposed to do. When I call the same handler from within other handlers, it doesn’t work, except if within the handler I’m calling from I place a display dialog in it. Any ideas? (Note: type_list and extension_list are globals.)
convert_files(image_files) -- This works
on test(temp_folder)
tell application "Finder"
--display dialog ("whatever") --uncomment this and it works
set image_files to every file of the temp_folder whose file type is in the type_list or name extension is in the extension_list
end tell
convert_files(image_files)
return true
end test
--Convert files in file list
on convert_files(image_files)
repeat with i from 1 to the count of image_files
set this_file to (item i of image_files) as alias
set the res to my resize_convert_save(this_file)
end repeat
return true
end convert_files