MacOSX 10.9.2 broke this Applescript progress bar :(
Hello,
Ever since I upgraded to MacOS 10.9.2, this download script with progress bar, which I frequently use, stopped working. Well the download bit works,
but the progress bar, do not show the progress anymore.
I have tried to resolve the issue, but I cannot get my head around what is wrong. So I hope someone out there can give me a helping hand, in solving
the problem.
The script is supposed to read the lines in the curl command output file, and show the current status in a dialog box, and then finish when it reaches
100%. But for some reason the dialog box, which is supposed to repeately show a dialog with the current progress, now do not appear before the
download reaches 100%. Hence no way to know the current progress of the download.
So is there anyone who knows why this script stopped working with MacOS 10.9.2, and even more importantly, anyone who knows how to fix it?
Thanks..
do shell script "curl -L -o ~/Desktop/file.dmg 'https://download.mozilla.org/?product=firefox-27.0.1-SSL&os=osx&lang=en-GB' > ~/Desktop/status 2>&1 &" with administrator privileges
set fileSize to 0
set curTransferred to 0
set curProgress to 0
repeat until curProgress = "100"
try
set lastLine to paragraph -1 of (do shell script "cat ~/Desktop/status")
set curProgress to word 1 of lastLine
set fileSize to word 2 of lastLine
set curTransferred to word 4 of lastLine
tell me
display dialog "Downloading. Please wait...
Status: " & curTransferred & " of " & fileSize & " (" & curProgress & "%)" buttons {"please wait", "cancel"} giving up after 4
if the button returned of the result is "cancel" then return
end tell
end try
end repeat
iMac, OS X Mavericks (10.9.1)