on adding folder items to this_folder after receiving added_items set the_file to item 1 of added_items if the_file is not ".DS_Store" then set file_info to the info for the_file set file_name to the name of file_info set file_path to the POSIX path of the_file set printer_path to path to home folder as text set printer_path to printer_path & "Library:Printers:" set printer_list to list folder printer_path set printer_names to {} repeat with i from 1 to number of items in printer_list set the_item to item i of printer_list if the_item is not ".DS_Store" then set item_name to text of characters 1 through ((length of the_item) - 4) of (the_item as string) as string set printer_names to printer_names & item_name end if end repeat if length of printer_names is 0 then display dialog "No printers available. Print job canceled." buttons {"OK"} with icon caution default button 1 do shell script "rm \"" & file_path & "\"" else set the_printer to choose from list printer_names with prompt "Choose the printer:" if the_printer is not false then set printer_path to printer_path & the_printer & ".app:Contents:MacOS:PrinterProxy" as alias set printer_path to POSIX path of printer_path do shell script "\"" & printer_path & "\" \"" & file_path & "\"; rm \"" & file_path & "\"" else do shell script "rm \"" & file_path & "\"" end if end if end if end adding folder items to