AppleScript名:ZipZap frameworkを使ってZipアーカイブ内の情報を取得 |
— Created 2015-10-11 by Takaaki Naganoya — 2015 Piyomaru Software use AppleScript version "2.5" use scripting additions use framework "Foundation" use framework "ZipZap" –https://github.com/pixelglow/zipzap set aPath to POSIX path of (choose file of type {"public.zip-archive"}) set oldArchive to current application’s ZZArchive’s archiveWithURL:(current application’s |NSURL|’s fileURLWithPath:aPath) |error|:(missing value) –> (ZZArchive) <ZZArchive: 0x7fe59aa932d0> set entryCount to oldArchive’s entries()’s |count|() –> 180 –this zip archive includes 180 file or folders inside set firstArchEntry to oldArchive’s entries()’s firstObject() –> (ZZOldArchiveEntry) <ZZOldArchiveEntry: 0x7fe593fa4dc0> set aList to oldArchive’s entries() as list repeat with i in aList set uSize to i’s uncompressedSize() as real set cSize to i’s compressedSize() as real set comF to i’s compressed() as boolean set encF to i’s encrypted() as boolean set modD to i’s lastModified() as date set chkSum to i’s crc32() as text –The CRC32 code of the entry file: 0 for new entries. set aFileMode to i’s fileMode() as text — The UNIX file mode for the entry: 0 for new or non-UNIX entries. This includes the file type bits. set aFileName to i’s fileName() as text log {aFileName, aFileMode, chkSum, modD, encF, comF, cSize, uSize} –> 21:28:01.817 (* {"ZXingObjC.framework/", "16877d", "0", date "2015年10月10日土曜日 10:07:16", false, false, 0.0, 0.0} *) –> 21:28:01.818 (* {"ZXingObjC.framework/Headers", "41453d", "2.393740531E+9", date "2015年10月10日土曜日 10:07:10", false, false, 24.0, 24.0} *) –> 21:28:01.820 (* {"ZXingObjC.framework/Versions/", "16877d", "0", date "2015年10月10日土曜日 10:07:10", false, false, 0.0, 0.0} *) –> 21:28:01.821 (* {"ZXingObjC.framework/Versions/3.1.0/", "16877d", "0", date "2015年10月10日土曜日 10:07:16", false, false, 0.0, 0.0} *) –> 21:28:01.822 (* {"ZXingObjC.framework/Versions/3.1.0/Headers/", "16877d", "0", date "2015年10月10日土曜日 10:07:16", false, false, 0.0, 0.0} *) –set aData to (i’s newDataWithError:false)–Uncompressed raw data –log aData end repeat |
More from my site
(Visited 349 times, 1 visits today)