Hi,
I'm creating a program where one of the tasks is to copy thousands of files with root privileges. I know there is no easy way to perform file operations with root privileges using Objective C, so I decided to put the series of do shell script commands in an AppleScript script file:
set filelist to {"file1", "file2", "file3", "etc"}
repeat with i in filelist
do shell script "cp -R " & i & " /destination_folder" with administrator priveleges
end repeat
Basically I feed it a list of files, then it does a loop and for each file in the list it does a copy operation using do shell script. I am going to invoke this script in my Objective C app using NSAppleScript. My question is, is it possible to put in a progress bar for the file copy procedure, assuming that I know the total number of files to be copied? This is easy to do in plain Objective C, but since the file copying is done in an AppleScript, I'm unsure of how im going to do this.
Any help would be appreciated
Thanks
I'm creating a program where one of the tasks is to copy thousands of files with root privileges. I know there is no easy way to perform file operations with root privileges using Objective C, so I decided to put the series of do shell script commands in an AppleScript script file:
set filelist to {"file1", "file2", "file3", "etc"}
repeat with i in filelist
do shell script "cp -R " & i & " /destination_folder" with administrator priveleges
end repeat
Basically I feed it a list of files, then it does a loop and for each file in the list it does a copy operation using do shell script. I am going to invoke this script in my Objective C app using NSAppleScript. My question is, is it possible to put in a progress bar for the file copy procedure, assuming that I know the total number of files to be copied? This is easy to do in plain Objective C, but since the file copying is done in an AppleScript, I'm unsure of how im going to do this.
Any help would be appreciated
Thanks