Q: AppleScript to Compress Files in Folder Individually
Hi! All!
AppleScript, CommandCompressFilesInFolderIndividually, in Question=>
>>>>>>>>>>
on open theFolders
-- items are passed in as a list, so get the first item
set theFolder to POSIX path of first item of theFolders
tell application "System Events"
set pathList to POSIX path of (every disk item of folder theFolder whose visible is true)
end tell
repeat with thisItem in pathList
set destinationPath to modifyPath(thisItem)
do shell script "ditto -c -k --sequesterRsrc --keepParent " & quoted form of thisItem & " " & quoted form of (destinationPath & ".zip") & " & > /dev/null &"
end repeat
end open
on modifyPath(oldPath)
set {oldTID, my text item delimiters} to {my text item delimiters, "/"}
set pathBits to text items of oldPath
set item -2 of pathBits to item -2 of pathBits & "Zip"
set newPath to pathBits as text
set my text item delimiters to oldTID
return newPath
end modifyPath
<<<<<<<<<
Hi! Script Gurus:
I have been using the aforementioned AppleScript. One vexing issue: Double Compressions.
Please Help! How to make the Compression Script skip those files which have already been compressed, such as: .zip, .sit, .sitx, gzip, etc.
Thanks gZillion!
Max NY
Posted on Sep 27, 2016 12:52 PM