I’ve been trying different things with the two scripts below. All I want one or both of them to do is print all of the AppleWorks files in a specified folder. I think I’ve got the loop right in either one (as I copied them from other sources) but the print always fails.
I can’t seem to figure out the final step to make AppleWorks actually print the documents. I’ve tried print window 1, print alias, print, etc. I have a bad/good feeling it’s a blatantly obvious mistake. I would appreciate any help.
Thanks,
Tom
set folder_to_print to choose folder with prompt "Choose the folder."
set item_list to list folder folder_to_print without invisibles
repeat with print_item in item_list
set the_alias to alias ((folder_to_print as string) & (print_item))
tell application "AppleWorks 6"
open the_alias
print the_alias
close window 1
end tell
end repeat
try
set the source_folder to "Macintosh HD:Users:teacher:Desktop:trial:" as alias
end try
set the item_list to list folder source_folder without invisibles
set source_folder to sources_folder as string
repeat with I from 1 to number of items in the item_list
set this_item to item I of the item_list
set this_item to (source_folder & this_item) as alias
tell application "AppleWorks 6"
open this_item
print window 1
close window 1
end tell
end repeat