-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open safari or default browser after printing #14
Comments
The So this works:
But this does not work:
|
@mckenfra i tried with https:// only. system() not throwing any error and give result 1(success). But it doesn’t open browser.. I don’t know is it because any permission limitation of printer module or not. i tried exec functions also to run shell script. Same result. Any thoughts? |
Printer drivers are run as the cupsd user. So its just not going to work - the wrong user is trying to open the browser.
This is the same issue that prevents me from being able to choose where the print file gets put, as the cupsd user has very limited privileges.
Rod
On 26 Jun 2021, at 3:17 pm, Hasgar D ***@***.******@***.***>> wrote:
@mckenfra<https://github.com/mckenfra> i tried with https:// only. system() not throwing any error and give result 1(success). But it doesn’t open browser.. I don’t know is it because any permission limitation of printer module or not. i tried exec functions also to run shell script. Same result. Any thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#14 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAKSADIJ6OLR7H5TEPUO5T3TUVPGVANCNFSM47JMQPVQ>.
|
@rodyager Yes I wanted the PDFs to appear in I got it working using Folder Actions. I modified Then, whenever a user subfolder is created under It works pretty well! If you like I could create a pull request to merge it into your project, but it does add more complexity, so I understand if you'd prefer to keep your driver simple 👍 |
That certainly would work.
Note that what my installer does is make /Users/Shared/PDFwriter a symbolic link to /var/spool/pdfwriter.
I then drag the “myusername” folder that gets created there when I print to my Dock.
Please do create a pull request. Your solution looks like a good idea.
Rod
On 26 Jun 2021, at 4:36 pm, Francis McKenzie ***@***.******@***.***>> wrote:
@rodyager<https://github.com/rodyager> Yes I wanted the PDFs to appear in ~/Downloads rather than /var/spool/pdfwriter/.
I got it working using Folder Actions<https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_folder_actions.html>. I modified RWTS-PDFwriter so that it automatically adds a Folder Action to /var/spool/pdfwriter as part of the installation process of the driver.
Then, whenever a user subfolder is created under /var/spool/pdfwriter, my Folder Action automatically creates another Folder Action on that user subfolder such that anything that appears in the user subfolder (i.e. any PDF printed using RWTS-PDFwriter) is automatically moved to the user's Downloads directory.
It works pretty well!
If you like I could create a pull request to merge it into your project, but it does add more complexity, so I understand if you'd prefer to keep your driver simple 👍
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#14 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAKSADLDH5NBWH2Z7PKQZ5TTUVYPRANCNFSM47JMQPVQ>.
|
Ok I'll create a pull request. Only problem is that the "Folder Actions" functionality is implemented using AppleScript, and I've checked these scripts into my branch as Ideally the plain-text applescript source would be checked-in to git, and then this would be compiled to |
@mckenfra how did you triggered folder actions from pdfwriter? May be using apple script i can open browser too. Could you please share that code snippet(apple script trigger) here? Or pull request will also work :) |
@hasgar-aot Yes you can look at the code once I've done the pull request. The tricky part is making it work automatically for any user - you need a Folder Action on the parent But in your case, all you would need to do is create your own Folder Action on your |
@mckenfra How will that Apple script be created in the /Downloads folder with limited permissions? I need this to be done by the printer module itself without any manual effort. Will we write that in a post-installation script? |
@hasgar-aot Your Folder Action would be created on the user's Also unfortunately I think Folder Actions are installed for the current-user-only, not system-wide. So after one user installs the So for your situation, maybe you could create another script that the user needs to run after the |
@mckenfra thank you very much. i'll try. it would be nice if you can do a pull request :) |
@rodyager @n1313 @mckenfra
I know this is not within the scope of this project. Do you know any way to open browser to a specific link after printing done. i tried system("open url), exec and all. no luck.
thank you
The text was updated successfully, but these errors were encountered: