Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

142
Visualizações
Accessing an Apple Numbers with JavaScript run thru Node.js

I have a JavaScript that works with tables in an Apple Numbers spreadsheet when run from Apples script editor. I needed to add file reading functionality to the script so I moved to Visual Studio Code and Node.js. The file reading now works but this line: let Numbers = Application("Numbers"); now kicks out an error "Application is not defined". Is there a package I need to install via npm or some other syntax I need to utilize to make this script work?

Chris

Below is the beginning of my code:

let Numbers = Application("Numbers");

let allHistory = Numbers.documents[0].sheets[1].tables["All History"];

let principalData = Numbers.documents[0].sheets[2].tables["Principal"]; 

const readline = require('readline');
const fs = require('fs');

let tempArray = [];
const principalDateArray = [];
const principalValueArray = [];

let rl = readline.createInterface({

    input: fs.createReadStream('../CSV/largecap.csv')

});

rl.on('line', function(line) {

    tempArray = line.split(',');
    principalDateArray.push(tempArray[0]);
    principalValueArray.push(tempArray[1]);

});

let arrayLength = principalDateArray.rows.Length;

for(let i = 0; i < arrayLength; i++){

    principalData.rows[i].cells[2].value = principalDateArray[i];
    principalData.rows[i].cells[3].value = principalValueArray[i];    

}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda