Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

redwgaontoy

macrumors newbie
Original poster
Jun 10, 2013
7
0
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
 

see.solve.

macrumors newbie
Oct 13, 2012
20
0
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.
 

redwgaontoy

macrumors newbie
Original poster
Jun 10, 2013
7
0
Script returned "SharedDocs:"

The script returned "SharedDocs:" but that doesn't work
 

redwgaontoy

macrumors newbie
Original poster
Jun 10, 2013
7
0
Using "Macintosh HD:Volumes:SharedDocs:" worked

Worked using the

Code:
set theOutputFolder to "Macintosh HD:Volumes:SharedDocs:"

Thank you!
 

redwgaontoy

macrumors newbie
Original poster
Jun 10, 2013
7
0
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.