Copy link to clipboard
Copied
Is this possible to unzip the file using indesign script
Hello,
If you are on MacOS you can use a terminal command :
JS Snippet :
function zip(file){
var mScript = "/~/Desktop/zip.scpt";
var mResult = app.doScript(mScript,ScriptLanguage.applescriptLanguage,file);
return mResult
}
zip.scpt
set myFile to item 1 of arguments
try
set mZip to do shell script "zip -r archive_name.zip " & quoted form of POSIX path of myFile
on error errStr number errorNumber
set mZip to 0
end try
return mZip
see : https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/zip.1.html
Copy link to clipboard
Copied
I can't find anything in the DOM so my guess is no.
However, you can do it with conventional JavaScript, example here:
javascript - Unzipping files - Stack Overflow
Otherwise you could make a batch file to unzip and run the InDesign JavaScript to do whatever else you had planned. ![]()
Brett
Copy link to clipboard
Copied
Thanks Brett
Copy link to clipboard
Copied
Hello,
If you are on MacOS you can use a terminal command :
JS Snippet :
function zip(file){
var mScript = "/~/Desktop/zip.scpt";
var mResult = app.doScript(mScript,ScriptLanguage.applescriptLanguage,file);
return mResult
}
zip.scpt
set myFile to item 1 of arguments
try
set mZip to do shell script "zip -r archive_name.zip " & quoted form of POSIX path of myFile
on error errStr number errorNumber
set mZip to 0
end try
return mZip
see : https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/zip.1.html
Copy link to clipboard
Copied
Thanks for your great support. Its working fine.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more