I'm trying to concatenate at variable within a path name string to make this script more efficient. This is the code I have so far. But I can't seem to find the right syntax needed in order to set the variable in the string.
I want johndoe to be replaces by variable user to make the code more maintainable for the future. My ultimate goal is to be able to copy multiple home folders including: movies, pictures, documents etc... onto a shared server.
I tried doing this:
But I received this error:
----------
also, is there a function that will pull the logged in users name, so that I can use that as a variable?
Code:
set vserver to POSIX file "/Volumes/johndoe"
set user to "johndoe" as string
set source to POSIX file "/Users/johndoe/Documents"
tell application "Finder"
duplicate source to vserver with replacing
end tell
I want johndoe to be replaces by variable user to make the code more maintainable for the future. My ultimate goal is to be able to copy multiple home folders including: movies, pictures, documents etc... onto a shared server.
I tried doing this:
Code:
"/Users/" & user & "/Desktop"
But I received this error:
"Finder got an error: Handler cant handle objects of this class." number -10010
----------
also, is there a function that will pull the logged in users name, so that I can use that as a variable?