Hi all - I posted the original thread on this a few years back ( https://forum.support.xerox.com/t5/Printing/quot-Xerox-Features-quot-driver-doesn-t-load-in-Safari-1... ) and have spent many hours researching the issue.
Apple broke it. I found the developer documentation that talked about deprecating the interface that allows these fancy third party drivers with executable code. Apple's enforcement of this policy has been on an app level, starting with Safari and then branching out to others. It used to be one workaround was to do a pdf preview and then print from the Preview app, but now the preview app is locked up too. I guess Acrobat Reader is a new requirement... for now. Also been using Firefox instead of Safari because of this printing issue.
Where to go from here? I see a few workarounds...
You specifically asked if there was a way to automate/script the programming in of accounting codes into a saved preset. The answer is yes. I haven't devised exactly how I want to implement this, but the following commands could be used based on a login script or maybe a custom app that prompts the user for their code and makes the change for them. I push out a couple presets... a mix of single sided vs double sided and b&w vs color.
In this example, the preset is named "Xerox B&W Letter 1-sided". You can retreive the current setting with:
/usr/libexec/PlistBuddy com.apple.print.custompresets.plist -c "print :'Xerox B&W Letter 1-sided':com.apple.print.preset.settings:com.xerox.printsettings:XRAccountingUserID"
And you can set the code to 1234 with this
/usr/libexec/PlistBuddy com.apple.print.custompresets.plist -c "set :'Xerox B&W Letter 1-sided':com.apple.print.preset.settings:com.xerox.printsettings:XRAccountingUserID 1234"
If the key doesn't exist, I believe set will fail. You can add it with this command. Unfortunately it will fail if the key already exists.
/usr/libexec/PlistBuddy com.apple.print.custompresets.plist -c "add :'Xerox B&W Letter 1-sided':com.apple.print.preset.settings:com.xerox.printsettings:XRAccountingUserID integer 1234"
I hope this helps. If you create something from this, I would love to see what it is!
Another thought I had was to try making our own in house ppd for our machines, including the most used options in the majority of our use cases in a simple non-binary driver. Not sure if you can include a free-form input field to type in a passcode, or if you are limited to dropdown menus.
Ideally Xerox would release a non-binary driver that was specifically built to be used by these sandboxed apps. Sure it wouldn't be pretty or even as easy to understand, but it would be something better than what pops up now in a sandboxed app. (see the previous post with screen shots).
Again, if anyone is interested in sharing their in-house workarounds for this, I'd like to hear it. Would be great to pool our efforts.