1
2 on process_item(source_file, new_name, results_folder)
3
4
5 try
6
7 set the target_path to ((results_folder as string) & new_name) as string
8 with timeout of 900 seconds
9 tell application "Image Events"
10 launch
11 set this_image to open file (source_file as string)
12 save this_image as JPEG in file target_path with icon
13 close this_image
14 end tell
15 end timeout
16 on error error_message
17 tell application "Finder"
18 activate
19 display dialog error_message buttons {"Cancel"} default button 1 giving up after 120
20 end tell
21 end try
22 end process_item