New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Applescript will not run line pointing to network


Post Reply New Thread Subscribe

 
Thread Tools
kj0

 
Member Since: Jun 01, 2009
Location: Brisbane, Australia
Posts: 12
kj0 is on a distinguished road
Mac Specs: MacBook | iMac | iPhone | iPod | eMac

kj0 is offline
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
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,236
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
Writing a Quality Post
QUOTE Thanks
kj0

 
Member Since: Jun 01, 2009
Location: Brisbane, Australia
Posts: 12
kj0 is on a distinguished road
Mac Specs: MacBook | iMac | iPhone | iPod | eMac

kj0 is offline
Yeap, Full access to that share. there is no authentication required.


lpadmin: Unable to open PPD file "smb://xx.xx.xxx.12/Printers/Dell_5130cdn.gz" - No such file or directory
QUOTE Thanks
kj0

 
Member Since: Jun 01, 2009
Location: Brisbane, Australia
Posts: 12
kj0 is on a distinguished road
Mac Specs: MacBook | iMac | iPhone | iPod | eMac

kj0 is offline
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
However, I continue to get a "Can't ever every file from Printers" Error - There's only 1 file in that folder.

This script does connect to that share though. I'm thinking if I can run this as a two part script?



Thanks.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,236
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
Quote:
Originally Posted by kj0 View Post
lpadmin: Unable to open PPD file "smb://xx.xx.xxx.12/Printers/Dell_5130cdn.gz" - No such file or directory
This error is quite specific - the file you're trying to copy over isn't available.

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
Writing a Quality Post
QUOTE Thanks
kj0

 
Member Since: Jun 01, 2009
Location: Brisbane, Australia
Posts: 12
kj0 is on a distinguished road
Mac Specs: MacBook | iMac | iPhone | iPod | eMac

kj0 is offline
Quote:
Originally Posted by vansmith View Post
Given that, it might actually be easier to write this as a shell script. Is there any particular reason you're using AppleScript?
I was looking for idea's on how to write up a program in Xcode with Multiple buttons for each particular printer - I did some research and couldn't work it out with xcode4 (xcode3 was a lot easier) so I did a little more research and came across this complete Applescript. I just needed to fill in the details, however, the only bit I changed was to run it from a remote location.


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


« Install Java Developer error | Support with Applescript »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
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 03:16 PM
AppleScript to run Oblivion, plz help. Loki0s OS X - Apps and Games 0 10-14-2011 05:02 PM
iphone4 creates collisions in my home wifi network smallpotato iPhone Hardware and Accessories 2 01-23-2011 12:11 AM
How to run script when connecting to particular network? bkhl OS X - Operating System 1 11-06-2010 05:14 PM
run Panther off external HD? os 9 on ibook? network with XP? kirkhings Internet, Networking, and Wireless 1 11-02-2003 07:16 PM

All times are GMT -4. The time now is 08:22 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?