My apologies for seemingly asking the same questions over but I must have some kind of mental block when it comes to figuring out how to properly reference files in Applescript. It still seems like rocket science to me but should be exceedingly simple. I have a script that works up to the point were I try to print a file generated by PDFMerge. The file clearly exists because I can see it and manipulate it but the ‘print’ command tells me it cannot find the file. I have tried every combination of ‘as alias’ and posix paths/files I can think of. I have the syntax right for the merge to work but cannot get it right for ‘print’. Can someone please help? Thanks.
Here is just the latest failure:
set tiff_folder to "Common:Tiff to PDF:Print Queue"
set merge_name to "Users:admin:Documents:Internet Downloads:temp_print_file.pdf"
set merge_name_posix to POSIX path of merge_name
tell application "Finder"
set file_todo to {}
repeat with file_name in folder tiff_folder
set end of file_todo to file_name as alias
end repeat
tell application "PDFmerge"
activate
clear
add file_todo
merge to merge_name_posix
end tell
print merge_name as alias
tell application "Printer Setup Utility"
set p to current printer
repeat
do shell script "sleep 5"
set s to status of p
if s is (idle) then exit repeat
end repeat
end tell
delete merge_name
delete file_todo
quit application "Printer Setup Utility"
quit application "Preview"
end tell