An AppleScript to compress a Finder selection लेख पर एक नजर डालें।
try
tell application "Finder"
set theSelection to the selection
set selectionCount to count of theSelection
if selectionCount is greater than 1 then
error "Please select only one Finder item before running this script."
else if selectionCount is less than 1 then
error "Please select one Finder item before running this script."
else
set theItem to (item 1 of theSelection) as alias
set destFolder to (container of theItem) as alias
set itemName to name of theItem
end if
end tell
do shell script ("ditto -c -k --sequesterRsrc --keepParent " & quoted form of POSIX path of theItem & space & quoted form of (POSIX path of destFolder & itemName & ".zip"))
on error theError
tell me
activate
display dialog "Error: " & theError buttons {"OK"} default button 1 with icon stop
end tell
end try
की
स्रोत
2012-05-25 06:44:39
संभव डुप्लिकेट [खोजक के "कम्प्रेस" मेनू आइटम के स्वरूप में ही एक ज़िप फ़ाइल बनाने में कैसे?] (Http://stackoverflow.com/questions/107903/how-to-create-a -zip-file-in-the-same-format-as-the-finders-compress-menu-item) – ceejayoz