Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Unzip files

Engaged ,
Oct 07, 2015 Oct 07, 2015

Is this possible to unzip the file using indesign script

TOPICS
Scripting
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Oct 07, 2015 Oct 07, 2015

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

Translate
Contributor ,
Oct 07, 2015 Oct 07, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 07, 2015 Oct 07, 2015

Thanks Brett

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 07, 2015 Oct 07, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 07, 2015 Oct 07, 2015
LATEST

Thanks for your great support. Its working fine.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines