I was asked to write a piece of code needing the expansion of a zip archive. I tried : set theZip to ((path to documents folder as text) & "my Kontainer.zip" as alias) set quotedPOSIXZip to quoted form of POSIX path of theZip do shell script "unzip " & quotedPOSIXZip
I got a very long error message beginning with :
error "checkdir error: cannot create my Kontainer Permission denied unable to process my Kontainer/. checkdir error: cannot create my Kontainer Permission denied unable to process my Kontainer/.DS_Store. checkdir error: cannot create __MACOSX Permission denied unable to process __MACOSX/. checkdir error: cannot create __MACOSX Permission denied unable to process __MACOSX/my Kontainer/.
So I decided to add the definition of the destination folder in the instruction.
set theZip to ((path to documents folder as text) & "my Kontainer.zip" as alias) set quotedPOSIXZip to quoted form of POSIX path of theZip set unZippedPath to text 1 thru -5 of (theZip as text) set quotedPOSIXunZippedPath to quoted form of POSIX path of unZippedPath do shell script "unzip " & quotedPOSIXZip & " -d" & quotedPOSIXunZippedPath
This time the expansion was done but with a strange - at least for me - behavior.
The created folder "my Kontainer" contain :
my Kontainer _MACOSX my Kontainer Click Me .app Click Me orig.app Click Me? copie.app my Kontainer 2017-01-06T10.57.34.nsf 2017-01-06T11.01.03.nsf Click Me .app Click Me orig.app Click Me? copie.app double click me old.app double click me.app folderNameInside.txt
The three apps in my Kontainer:_MACOSX:my Kontainer are zero byte files which seems to be phantoms of the three apps with the same names in my Kontainer:myKontainer. The late ones are packages containing a document.wflow file as well as a MacOS:Application Stub item. The two other applications are scripts saved as applications in flat files.
Is it the normal behavior or am I making something wrong ?
Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France) jeudi 12 janvier 2017 13:10:17
|