Copy link to clipboard
Copied
Hi,
We have a use case where we download assets in AEM which would contain some renditions. These are downloaded as zip files but when we try to unzip using Mac Archive Utility they wouldn't open rather we have to use some third party applications to unzip. What complicates it is that not all zip files open using the same third party unzip application. We observed that we are seeing this issue only when the file type is .idml and wondersing if there is a work around to unzip .idml files using Mac archive utility.
Thanks!
Mac's archive utility can't unzip IDML archives (even if you change the extension to .zip).
The method I know is that you need to use the unzip shell command:
unzip <source zip or idml> -d <output dir>
In some cases this may not work either in which case you'll need to 'fix' the original zip first using the zip command:
zip -FF <source zip or idml> --out <output zip>
then unzip the resulting zip as above.
Actually, you may want to just always run the 'fix' script first anyway
...Copy link to clipboard
Copied
IDML file is a "basic" ZIP archive.
I'm not a Mac user - but can't you assign IDML extension to your preferred unzip'ing tool?
Copy link to clipboard
Copied
Somewhat aside, but ZIP is an extremely mature, stable and nearly universal format. I'd have questions about any modern tool that cannot unzip any current variation. I haven't needed alternate versions since.... the 1990s?
Copy link to clipboard
Copied
Mac's archive utility can't unzip IDML archives (even if you change the extension to .zip).
The method I know is that you need to use the unzip shell command:
unzip <source zip or idml> -d <output dir>
In some cases this may not work either in which case you'll need to 'fix' the original zip first using the zip command:
zip -FF <source zip or idml> --out <output zip>
then unzip the resulting zip as above.
Actually, you may want to just always run the 'fix' script first anyway.
I found these instructions somewhere on the net years ago. It always worked so far.
You of course can automate this process one way or another instead of running it manually from Terminal (for example, with an AppleScript droplet).
Copy link to clipboard
Copied
Exactly what I was going to post.
You would be better off downloading a different ZIP application that is more robust than the pathetic method that Apple have out of the box.
Copy link to clipboard
Copied
Wow! That's super helpful and works like a charm.
Thanks.
Copy link to clipboard
Copied
Update:
The unpackage UCF AppleScript command in InDesign can also unpackage (unzip) IDML files, so it can be done in one step:
tell application "Adobe InDesign 2024" to unpackage UCF UCF file "posix-path-to-idml-file" destination folder "posix-path-of-destination-folder"
Copy link to clipboard
Copied
Another update:
When in InDesign run the ExtendScript code below from InDesign's Scripts panel.
Should work in Windows and on macOS:
/*
ExtendScript code. Run the script file with suffix *.jsx from InDesign's Scripts folder.
Select an IDMS file through an open dialog.
The file will be unzipped to a folder with the name of the IDML file without the suffix.
*/
var getIDMLFile = File.openDialog
(
"Open InDesign IDML File" ,
"*.idml",
false
);
if( getIDMLFile == null )
{
alert( "NO FILE SELECTED." );
exit();
};
if( !getIDMLFile.name.match(/\.idml$/) )
{
alert( "Selected file is not an IDML file." );
exit();
};
try{
var targetFolder = Folder( getIDMLFile.parent +"/"+ getIDMLFile.name.replace(/\.idml$/,"") );
// Unpack IDML file:
app.unpackageUCF( getIDMLFile , targetFolder );
}catch(e)
{
alert( "Could not unzip file." );
exit();
};
alert( "Done" );
Note: tested with InDesign 2024 version 19.5.0.84 on macOS.
Regards,
Uwe Laubender
( Adobe Community Expert )