rodyager/RWTS-PDFwriter

Launch application after generate PDF

Closed this issue · 2 comments

I am trying to launch an application after the pdf file is created in /var/spool/cups/pdfwriter/{user}. I just added this code after de writepdf function is called:

NSTask *task = [[NSTask alloc] init];
task.launchPath = @"/usr/bin/open";
task.arguments = @[@"-a", @"/Applications/Gestiona envia/GestionaEnvia.app", @"--args", @"print"];
[task launch];

No exception or error is launched, but the application does not open. The path is correct. Any idea why this can be?

Thanks for your code!!

Thanks for your reply,

You were absolutely right. Due to security issues pdfwriter was not able to launch another app. To simulate that, I made a folder action using applescript and javascript in order to launch the app when pdfwriter creates the file in a specified folder.

Thank you again for your project, it was really helpfull to me