-- Dieter May , August 2011 if (count documents) = 0 then return repeat until (background tasks = {}) delay 0.5 end repeat try tell active document set idml_path to (my remove_ext(full name) & ".idml" as string) if (modified) = true then save to (full name) --asynchronous export file format InDesign markup to idml_path export format InDesign markup to idml_path end tell on error error_mess display dialog error_mess exit repeat return end try display notification idml_path with title "IDML-Export" sound name "Tink" on remove_ext(this_item) set this_item to this_item as string set the_offset to offset of "." in (reverse of characters in this_item as string) if the_offset is not 0 then set this_item to characters 1 thru -(the_offset + 1) of this_item as string return this_item end remove_ext on make_folder(hfs_folder_path) set the folder_path to quoted form of POSIX path of (hfs_folder_path as string) do shell script "if [ ! -d " & folder_path & " ]; then mkdir -p " & folder_path & "; fi" end make_folder