I have just started out on AppleScript. I am trying to write a Droplet where I can drop a bunch of files to be converted to jpgs. The script below works fine when I drop a bunch of files but doesn’t work when I run it as a regular app by double-clicking it. Can anyone help? Thanks.
on run
choose file with prompt "Select files to convert to jpgs:" with multiple selections allowed
open {result}
end run
on open the_Droppings
set destination_folder to choose folder with prompt "Where do you want to save the jpgs?" as string
try
repeat with a_file in the_Droppings
set file_path to a_file as string
with timeout of 900 seconds
tell application "Image Events"
launch
set the_image to open file file_path
save the_image as JPEG in destination_folder with icon
close the_image
end tell
end timeout
end repeat
on error error_msg
display dialog error_msg
end try
tell application "Finder"
open folder destination_folder
end tell
end open