ScriptEditor: Concatenate path of a file
Hello there,
I'm writing a very simple script in ScriptEditor witch should just find a folder on desktop and move/copy it into another folder (that still on desktop).
I'm struggling on making the script work without giving it the direct path to the folder, I would like it to get the current user short name and calculate the path to the folder.
Right now I'm at this point:
tell application "Finder"
set _info to system info
set UserID to short user name of _info
set sourceFolder1 to POSIX file ("/Users/" & UserID & "/Desktop/PROVA")
set destination to POSIX file ("/Users/" & UserID & "/Desktop/TEST")
if exists sourceFolder1 then
copy sourceFolder1 to the destination
end if
end tell
This compile correctly but gives me the error:
"Finder got an error: Can’t get folder \"/Users/[userID]/Desktop/PROVA\"." number -1728 from file "Macintosh HD:Users:[userID]:Desktop:PROVA"
How can I solve this?
I'm new to this language so I might miss the correct syntax.
Thanks a lot for the help
Alessandro.
Mac mini, macOS High Sierra (10.13.6)