Applescript how to save to PC on network

Discussion in 'Mac Programming' started by redwgaontoy, Jun 10, 2013.

  1. macrumors newbie

    Joined:
    Jun 10, 2013
    #1
    Currently I have an Applescript that saves a mail attachment to my Desktop. I would like to change it to save to a a PC on my network. Not really sure how to change it.

    The PC shows up in Finder under shared and the server shows as

    smb://shipping/SharedDocs/

    Code:
    on perform_mail_action(theData)
    	
    	set theOutputFolder to "Macintosh HD:Desktop"
    So I would like to change theOutputFolder to the shipping/SharedDocs/

    I am not really sure how to do this and any assistance would be much appreciated.

    Scott
     
  2. macrumors newbie

    Joined:
    Oct 13, 2012
    #2
    The easy way is to find the name of that folder is to select the PC folder in the Finder, then run the following script:
    Code:
    tell app "Finder"
    	(selection as alias)
    end
    The result will be the folder location. Copy and paste that into your script.
     
  3. thread starter macrumors newbie

    Joined:
    Jun 10, 2013
    #3
    Script returned "SharedDocs:"

    The script returned "SharedDocs:" but that doesn't work
     
  4. macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #4
    Try :

    Code:
    set theOutputFolder to "Macintosh HD:Volumes:SharedDocs:"
     
  5. macrumors newbie

    Joined:
    Oct 13, 2012
    #5
    That's curious. It works for me. I wonder what the difference is.
     
  6. thread starter macrumors newbie

    Joined:
    Jun 10, 2013
    #6
    Using "Macintosh HD:Volumes:SharedDocs:" worked

    Worked using the

    Code:
    set theOutputFolder to "Macintosh HD:Volumes:SharedDocs:"
    Thank you!
     
  7. thread starter macrumors newbie

    Joined:
    Jun 10, 2013
    #7
    Now how do I replace the existing file

    I need this script to replace the existing saved attachment

    My original code to save is
    Code:
    save theAttachment in theSavePath 
    I tried

    Code:
    save theAttachment in theSavePath with replacing 
    This did not work, but just need to overwrite existing file
     

Share This Page