set source to (choose folder default location ("~/Desktop/") with multiple selections allowed)
repeat with filetocopy in source
set n to (quoted form of (POSIX path of filetocopy)) & " "
set dir to do shell script "dirname " & n
set bn to do shell script "basename " & n
set n2 to "." & bn
set n3 to dir & "/" & n2
do shell script "mv " & n & space & quoted form of n3
end repeat
display dialog "Folders Hidden!" buttons {"OK"} default button 1
It refuses to make ~/
into an alias. However, I can't hard-code the path with my username as I am releasing this for friends. Any simple solutions?
You don't need the ~/. Use
(Path to desktop)
instead.