I created a simple shortcut that prompts me for the number of copies I want to print along with the paper type. It then runs an "lpr" command in ZSH using the "Run Shell Script" action in Shortcuts. The shortcut worked fine until I updated to Sonoma. Now I get an "Operation Not Permitted" error:
I verified that "lpr" command still works in the terminal and I'm able to print. I've tried the following with no luck:
- Tried different Macs (M2 Pro Mac mini, M1 Pro MBPRo, M2 MBP Air)
- In the security settings I gave full disk access to: lpr, zsh, bash and the Shortcuts app
- Reset the shortcut privacy settings
- Tried running the shortcut on files in my downloads folder and documents folder
- Searched the web and forums for a solution
Edit: it seems the issue is caused by having spaces in the file's path. I tried replacing the spaces with "\ " and it didn't work. Will keep trying!
Any help is appreciated.
Here's a screenshot of my Run Shell Command, I build a string using the file's path along with a predetermined lpr command to print to my printer and set media type.
I verified that "lpr" command still works in the terminal and I'm able to print. I've tried the following with no luck:
- Tried different Macs (M2 Pro Mac mini, M1 Pro MBPRo, M2 MBP Air)
- In the security settings I gave full disk access to: lpr, zsh, bash and the Shortcuts app
- Reset the shortcut privacy settings
- Tried running the shortcut on files in my downloads folder and documents folder
- Searched the web and forums for a solution
Edit: it seems the issue is caused by having spaces in the file's path. I tried replacing the spaces with "\ " and it didn't work. Will keep trying!
Any help is appreciated.
Here's a screenshot of my Run Shell Command, I build a string using the file's path along with a predetermined lpr command to print to my printer and set media type.
Last edited: