Posted on 04-01-2014 10:35 AM
Ok, I've hacked away for hours, but I just can't seem to finish an Applescript that I'm working on for our image.
I've managed to create the following:
- an Applescript that prompts for UserID, Password, Email and sets up an Outlook account
I'd like to do the following within the same script:
- take the UserID variable that was created above and edit the printers.conf file by changing the DeviceURI...
from (current file text in printers.conf in cups.DMG that is deployed):
lpd://EMPLOYEE@10.100.153.197
to:
lpd://{UserID}@10.100.153.197
Sorry if that's complicated. Hard to be concise. I've search the posts on JAMF, but not breaking through.
Solved! Go to Solution.
Posted on 04-01-2014 10:39 AM
Here's the example script, for reference
https://www.dropbox.com/s/qeq1s5xw593t5tw/Outlook%26Printer-Example.scpt
Posted on 04-04-2014 12:49 PM
You can use the following shell command:
lpadmin -v lpd://{UserID}@10.100.153.197 -d [Printer Queue Name]
Posted on 04-08-2014 01:33 PM
Nevermind, seems that I got it. For some reason, I have to run the following, twice, to get the Duplex option triggered...
do shell script "/usr/sbin/lpadmin -p Company_SecurePrint -E -v lpd://E123456@10.100.153.197/secureprint -E -D "Company SecurePrint" -m drv:///sample.drv/generic.ppd -o Duplex=DuplexTumble -o Option1=True"
Posted on 04-01-2014 10:39 AM
Here's the example script, for reference
https://www.dropbox.com/s/qeq1s5xw593t5tw/Outlook%26Printer-Example.scpt
Posted on 04-01-2014 10:39 AM
Here's the example script, for reference
https://www.dropbox.com/s/qeq1s5xw593t5tw/Outlook%26Printer-Example.scpt
Posted on 04-01-2014 10:39 AM
Sorry, double post for some reason
Posted on 04-01-2014 12:36 PM
We use an AppleScript app @ login to mount drives & printers.
Not sure if it'll help, but linking just incase it does:
http://macmule.com/2011/09/08/how-to-map-drives-printers-based-on-ad-group-membership-on-osx/
Posted on 04-01-2014 02:03 PM
Thanks bentoms.
I think just switching out the text should do the trick, but applescript text replacement is proving to be a pain as I hack away.
Posted on 04-01-2014 02:39 PM
I'm at a bit of a loss. The printer is set up in the advanced tab (being an LPD setup) of Sys Prefs.
So, scripting the manual setup via "AddPrinter" just wasn't working.
Then, I switched to the idea of dropping the printers.conf file in by DMG and editing that. But, it's proving to be a pain.
Posted on 04-02-2014 07:05 PM
I took a quick look at what you're wanting to do and see a stumbling block.
The script is going to run under the current user's credentials and his privileges but I'm finding the /private/etc/cups/printers.conf file isn't even readble by the Standard user.
Not sure what you're referring to by "cups.DMG". Where's that coming into play?
Posted on 04-04-2014 12:49 PM
You can use the following shell command:
lpadmin -v lpd://{UserID}@10.100.153.197 -d [Printer Queue Name]
Posted on 04-08-2014 01:12 PM
Thanks all. Yeah, passing the variable into lpadmin looks good.
Just gotta find the right Generic postscript driver now.
Seeing this one in the PPD... *PPD-Adobe: "4.0"
Default "drv:///sample.drv/Generic.ppd" doesn't work with our duplex system.
Posted on 04-08-2014 01:16 PM
Or, at least, for whatever reason, I can't seem to get the option triggered to select "Duplexer" in the options, using the default generic driver.
Posted on 04-08-2014 01:19 PM
Using the "-o" option, I've triggered:
Duplex/2-Sided Printing: None *DuplexNoTumble DuplexTumble
Option1/Duplexer: False *True
But, still no dice. Alas. Still hammering away.
Posted on 04-08-2014 01:33 PM
Nevermind, seems that I got it. For some reason, I have to run the following, twice, to get the Duplex option triggered...
do shell script "/usr/sbin/lpadmin -p Company_SecurePrint -E -v lpd://E123456@10.100.153.197/secureprint -E -D "Company SecurePrint" -m drv:///sample.drv/generic.ppd -o Duplex=DuplexTumble -o Option1=True"