AppleScript (, ), Shane Stanleys ASObjC Runner, , , . ,
tell application "ASObjC Runner"
reset progress
set properties of progress window to {button title:"Abort Backup", button visible:true, message:"Backing up the '" & (POSIX path of folderalias) & "' directory.", detail:"There are " & foldersize & " GB of data to backup – this might take some time.", indeterminate:true}
activate
show progress
end tell
try
<your backup operation here>
end try
tell application "ASObjC Runner" to hide progress
( " " ) - , ( AS). , do shell script - , fin [ ASObjC Runner.
ASObjC Runner AppleScript ( script AppleScript), Resources ( Finder, Show Package Contents ) path to resource , using terms from block - , , , , , : tell POSIX- (tell application (POSIX path of (path to resource "ASObjC Runner.app"))).
:
, :
set computerName to do shell script "networksetup -getcomputername"
set folderAlias to path to users folder
tell application "System Events" to set folderSize to physical size of folderAlias
set folderSize to round(folderSize / 1.0E+9 * 100) / 100
display alert "User profile backup utility" message ¬
"The computer name is: " & computerName & return & return & ¬
"The '" & (POSIX path of folderAlias) & "' directory size is: " & "~" & folderSize & " GB" & return & return & ¬
"Would you like to backup the '" & (POSIX path of folderAlias) & "' directory now?" & return ¬
buttons {"Cancel", "Backup Now"} default button "Backup Now"
set shellCmd to "hdiutil create ~/Desktop/'" & computerName & "'.dmg -srcfolder /test/"
try
set shellOutput to do shell script shellCmd with administrator privileges
end try
display dialog shellOutput