AnsweredAssumed Answered

Applescript.  How to tell..

Question asked by lylacinc on Apr 9, 2018
Latest reply on Apr 10, 2018 by fmpdude

A client has an applescript which he has been using to print PDF files that are exported from a FileMaker container to his desktop.  The applescript opens the PDF using Adobe Acrobat Pro, prints the file and then closes the document.  It works fine, but not everyone who needs to use this function has Adobe Acrobat Pro.


So we are trying to change this to run the print portion in Finder.   I have updated the applescript (I'm a novice using applescript) and it works fine.   However, the client tells me that he needs to be able to put his printer on PAUSE while running the script so that all the documents load up in his print queue, then he can review which documents are queued up and then print after review.  He does this process remotely, so he does need the printer to be on.  


So what I need now is to modify the applescript to choose the "Add to Printer" option in the pop up window that appears after the Finder has "pushed" the print button.     I'm having no luck.


Below is the modified applescript.   Under tell process "Preview", the second keystroke return is executed when this window pops up which of course is wrong because it "Resumes" printing.   How to I tell applecript to click "Add to Printer" instead.     I have tried to state it a few ways, but I have not figured out how to tell it correctly.   


Thanks for any help!


popup message.png


Screen Shot 2018-04-09 at 1.02.34 PM.png