-- back to original page
-- ui strings
set choose_header to "Wählen Sie einen Ordner, in den die Bilder kopiert werden sollen:"
set err_rep to "Fehlerbericht "
tell application "RagTime 6.5"
set is_linked to false
set link_list to {}
set error_list to {}
tell document 1
set pic_num to 0
try
set pic_num to (count pictures)
end try
repeat with x from 1 to pic_num
try
copy (source file of picture x) to end of link_list
on error the_err number num
set p_name to ""
try
set p_name to name of picture x
end try
copy {p_name, the_err, num} to end of error_list
end try
end repeat
end tell
end tell
set pic_num to count link_list
if (pic_num > 0) then
set target_folder to (choose folder with prompt choose_header)
tell application "Finder"
repeat with x from 1 to pic_num
set curr to item x of link_list
set file_name to curr as text
set file_name to name of file file_name
try
duplicate curr to target_folder
on error the_error number num
copy {file_name, the_error, num} to end of error_list
end try
end repeat
end tell
end if
if (count error_list) > 0 then
tell application "RagTime 6.5"
set errors to (make new document at end with properties {component types:table})
tell table 1 of errors
set value of cell "A1" to err_rep & ((current date) as string)
set r to count error_list
repeat with x from 1 to r
set curr to item x of error_list
repeat with Y from 1 to 3
set value of cell Y of row (x + 1) to item Y of curr
end repeat
end repeat
end tell
end tell
end if
error_list