| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Jun 01, 2009
Location: Brisbane, Australia
Posts: 12
![]() Mac Specs: MacBook | iMac | iPhone | iPod | eMac
|
HI All.
I've just written a small (Very Small) applescript to add a printer for those users we have here in our organisation that have a MacBook. We are primarily PCs so of course our printers are set up that way. The issue I am having is when I point the line for the printer driver to a network location the script can not find that file, however, when I run the line for a local location it works and installs. The network location is just a NAS with Everyone set to Full Permission. Code:
do shell script "/usr/sbin/lpadmin -p QF_STAFFROOM -E -v lpd://<Server>.<Blah>.<blah>/P2132QF26D513/P2132QF26D513 -P smb://xx.xx.xxx.12/Printers/Dell_5130cdn.gz -D \"QF StaffRoom\"" IF I run this commend it works like a treat. Code:
do shell script "/usr/sbin/lpadmin -p STAFFROOM -E -v lpd://<Server>.<Blah>.<blah>/P2132QF26D513/P2132QF26D513 -P /resources/Dell_5130cdn.gz -D \"StaffRoom\"" Thanks |
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,302
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
Do you have to authenticate to access the Windows share?
Have you tried executing that command from the command line to see what errors (if any) are printed back? Important Links: Community Guidelines : Use the reputation system if you've been helped. M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
![]() Member Since: Jun 01, 2009
Location: Brisbane, Australia
Posts: 12
![]() Mac Specs: MacBook | iMac | iPhone | iPod | eMac
|
|
| QUOTE Thanks | |
![]() Member Since: Jun 01, 2009
Location: Brisbane, Australia
Posts: 12
![]() Mac Specs: MacBook | iMac | iPhone | iPod | eMac
|
Ok.. I don't think I'm going to be able to do it via installing directly from a share, but what if I was to have it copy and create a folder and drop the file locally?
Code:
mount volume "smb://xx.xx.xxx.12/public/Printers" tell application "Finder" duplicate every file of "Printers" to folder "resources" of home end tell This script does connect to that share though. I'm thinking if I can run this as a two part script? Thanks. |
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,302
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
Quote:
Also note that smb shares are mounted to /Volumes (it's this way at least if you do it through the GUI). Given that, it might actually be easier to write this as a shell script. Is there any particular reason you're using AppleScript? Important Links: Community Guidelines : Use the reputation system if you've been helped. M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
|
| QUOTE Thanks | ||
![]() Member Since: Jun 01, 2009
Location: Brisbane, Australia
Posts: 12
![]() Mac Specs: MacBook | iMac | iPhone | iPod | eMac
|
Quote:
Would it be easier to make the first step of the code to connect to the share and then the second part to link to /volumes? |
|
| QUOTE Thanks | ||
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Very slow network directory listing - but fast data transfer speed once listed? | I_am_Jono | Internet, Networking, and Wireless | 1 | 01-12-2012 02:16 PM |
| AppleScript to run Oblivion, plz help. | Loki0s | OS X - Apps and Games | 0 | 10-14-2011 04:02 PM |
| iphone4 creates collisions in my home wifi network | smallpotato | iPhone Hardware and Accessories | 2 | 01-22-2011 11:11 PM |
| How to run script when connecting to particular network? | bkhl | OS X - Operating System | 1 | 11-06-2010 04:14 PM |
| run Panther off external HD? os 9 on ibook? network with XP? | kirkhings | Internet, Networking, and Wireless | 1 | 11-02-2003 06:16 PM |
All times are GMT -4. The time now is 05:57 AM.
Powered by vBulletin