-1

I would like to know how can we hide the Progress Bar of Finder during a copy ?

I spent hours seeking without any results. I search something like that :

tell application "Finder"
        set theItems to items of disk thisVolume
        tell application "Finder" to set visible of process "Finder" to false <---- here
        move theItems to Destination_Folder with replacing
end tell

As soon as the copy (or move) is launched, the Copy bar is in front.

Thank you for your help.

Joseph
  • 209
  • 2
  • 11
  • The first way is to think about how you would do it manually. Start the copy and hide the Finder is the only way then. But after activating the Finder the progress bar will appear again. My suggestion is to not use the Finder for this task but to use a simple `do shell script` in combination with `mv` – ShooTerKo Jan 29 '15 at 07:51
  • Thank you ShooTerKo. I do not know how to code "do shell" command. How would you write the command to do it ? – Joseph Jan 29 '15 at 13:10
  • Are you sure that you want to **move** the files? Moving means to copy files and delete the original file. – ShooTerKo Jan 29 '15 at 13:20

1 Answers1

0

Try this instead of your move:

-- get the POSIX path of the destination folder
set destinationPath to POSIX path of (Destination_Folder as string)

-- looping through the items
repeat with anItem in theItems
    -- get the POSIX path of the file to move
    set sourcePath to (POSIX path of (anItem as string))
    -- combine all information and trigger the mv shell script 
    do shell script "mv -f " & (quoted form of sourcePath) & " " & (quoted form of destinationPath)
end repeat

Cheers, Michael / Hamburg

ShooTerKo
  • 2,242
  • 1
  • 13
  • 18
  • Thank you very much for your help. This code almost work perfectly. I changed mv with cp in order to copy, but it does not copy folders – Joseph Jan 29 '15 at 14:54
  • do shell script "cp -f -rv " & (quoted form of sourcePath) & " " & (quoted form of destinationPath) It worked. Thank you ShooTerKo – Joseph Jan 29 '15 at 15:01