Results 1 to 6 of 6
  1. #1
    Applescript will not run line pointing to network

    Member Since
    Jun 01, 2009
    Location
    Brisbane, Australia
    Posts
    12
    Specs:
    MacBook | iMac | iPhone | iPod | eMac
    Applescript will not run line pointing to network
    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

  2. #2
    Applescript will not run line pointing to network
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,398
    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
    Writing a Quality Post

  3. #3
    Applescript will not run line pointing to network

    Member Since
    Jun 01, 2009
    Location
    Brisbane, Australia
    Posts
    12
    Specs:
    MacBook | iMac | iPhone | iPod | eMac
    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

  4. #4
    Applescript will not run line pointing to network

    Member Since
    Jun 01, 2009
    Location
    Brisbane, Australia
    Posts
    12
    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
    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.

  5. #5
    Applescript will not run line pointing to network
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,398
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    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

  6. #6
    Applescript will not run line pointing to network

    Member Since
    Jun 01, 2009
    Location
    Brisbane, Australia
    Posts
    12
    Specs:
    MacBook | iMac | iPhone | iPod | eMac
    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?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to use a shortcut to run an applescript?
    By nightfury2986 in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 01-18-2015, 05:02 PM
  2. Use Applescript to run a terminal command
    By Turk182 in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 02-12-2009, 12:08 PM
  3. pointing a directory to a network share
    By notthedoorman in forum OS X - Operating System
    Replies: 2
    Last Post: 11-12-2008, 04:00 PM
  4. Run applescript on start-up
    By slugzzz in forum Running Windows (or anything else) on your Mac
    Replies: 3
    Last Post: 09-11-2007, 01:51 AM
  5. Applescript - Run
    By MacAddikt in forum OS X - Apps and Games
    Replies: 3
    Last Post: 02-08-2005, 08:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •