Monday, October 22, 2018

#1 2018-06-11 01:44:35 pm

TheMalcolmConnection
Member
Registered: 2018-06-11
Posts: 1

Mapping Drive with Prompt/Adding Printer and Drivers

Hey all!

New here, so I apologize in advance for anything ridiculous I'm sure to ask, but was wondering if anyone had experience in creating a script that does this:

1) Maps a network share with a login prompt.
2) Detects what OS the computer has.
3) Installs printer drivers based on OS (along with finishing options for the MFD).
4) Installs the print object as well as presets.

I work at a University and we require our students to upload jobs to a print server (Papercut) and they absolutely hate it and would rather print directly to the object. We've tried writing out directions to have them add the printers themselves and at least 80% of them end up coming to the HelpDesk to have us do it for them.

Any thoughts would be appreciated (OR just tell me this is a ridiculous request)!

Thanks all!

Offline

 

#2 2018-06-12 02:46:58 pm

t.spoon
Member
From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 314

Re: Mapping Drive with Prompt/Adding Printer and Drivers

1) Maps a network share with a login prompt.


This is just a basic example, you can do things like store the username and/or password locally and autofill it as defaults in the dialogs, save it in keychain, use the system UI to ask for username and password instead of doing it yourself, put in more error handling, there is a lot more you might want. But basically:

Applescript:

tell application "Finder"
   set serverPath to "[whatever the serve path is]"
   set userName to the text returned of (display dialog "Please enter your username for the server." default answer "" buttons {"Submit", "Cancel"} default button "Submit")
   set userPassword to the text returned of (display dialog "Please enter your password for the server." default answer "" buttons {"Submit", "Cancel"} default button "Submit")
   set openServerLink to "smb://" & userName & ":" & userPassword & "@" & serverPath
   open location openServerLink
end tell

2) Detects what OS the computer has.

Applescript:

set macOSversion to system version of (system info)

3) Installs printer drivers based on OS (along with finishing options for the MFD).
Where are the print drivers and how are they installed? Do you have URL's for the computer to download them based on the OS version, or copy them off a network share, and then you just run an installer? Or do you need it to automate adding them through Printers & Scanners in System Preferences? The prior cases are almost certainly possible, no idea about the later case.

4) Installs the print object as well as presets.
Sorry, no idea what a print object is.


Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)