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

doobs

macrumors regular
Original poster
Jul 19, 2008
136
0
I am trying to write an AppleScript using Automator that takes as input a file and copies that file to a certain location. The input variable called "input" is in the format "Mac HD:Users:myname:folder:file.txt" and this is causing me problems. The location I am copying to requires admin privileges, so I am executing:

do shell script "/bin/cp " & input & " /System/Library/CoreServices/file.txt" with administrator privileges

This variable "input" is not in the correct pathname format and I cannot figure out how to fix this. Also, I tried another approach using:

tell application "Finder"
copy file input to "/System/Library/CoreServices/file.txt"

However, Automator complains when I compile this last script that access is not allowed (and also doesn't like having "with administrator privileges" at the end). Any suggestion? Thanks in advance...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.