I am completely new here. I got a little knowledge of apple scripting manly just putting terminal commands into a script. I want to run a terminal command.
cp -Rn /source/* /destination/
I can do that easily
do shell script “cp -Rn /source/* /destination/”
but what I want to be able to do is have a gui pop up and let me select the source folder and select the destination folder.
Possibaly would also like a box to show me what is happening if I used the v command to give an out put.
cp -Rnv /source/* /destination/
Can any one help me with this or tell me what I should search for relating to the folder selector part?
Maybe code like follows will already give you some idea about the process:
property verbose : true
set sourcefolder to (choose folder with prompt "Please choose a source folder" without multiple selections allowed and invisibles)
set destfolder to (choose folder with prompt "Please choose a destination folder" without multiple selections allowed and invisibles)
set sourcefolder to quoted form of (POSIX path of (sourcefolder as Unicode text) & "*")
set destfolder to quoted form of POSIX path of (destfolder as Unicode text)
set command to "cp -Rn " & sourcefolder & space & destfolder
set output to do shell script command
if verbose is true then
tell me
activate
display dialog output
end tell
end if