View Single Post
  #2547  
Old 22.01.2023, 21:03
tribumx tribumx is offline
I will play nice!
 
Join Date: Jul 2022
Posts: 1
Default EventScript with extracted Archive Name

Is it possible to access the extracted Archive Name? Can't find the value here in examples of scripts or in the API?

I can get the ArchiveName how the archive itself is named. But not the folder name inside the archive what is extracted. I want to access it and pass it as an argument to my python script. Any clues?

Code:
disablePermissionChecks();

var extractionFolder;
var archiveName;

package.getArchives().forEach(function (archive) {
  archiveName = archive.getName();
  archive.getDownloadLinks().forEach(function (link) {
    while (
      link.getExtractionStatus() == "IDLE" ||
      link.getExtractionStatus() == "RUNNING"
    )
      sleep(1000);
  });
});

var packagename = package.getName();
var folderLocation = package.getDownloadFolder();
var cmd = "python";
var script = "/output/Scripts/Uppy/sorter.py";

alert(packagename, extractionFolder, archiveName)

var command = [cmd, script, packagename, folderLocation, extractionFolder]
alert(callSync(command))
Reply With Quote