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

302
Visualizações
Populating images on a Keynote file using Javascript for Automation (JXA)

I would like to populate a keynote presentation with images that I have stored in my home directory.

Each image should go to one slide. I've looked a lot on the internet but I've only an example which doesn't work for me.

let app = Application('Keynote')

app.documents[0].currentSlide.images.push(app.Image({
  file: Path("/path/to/image.jpg")
}))

This is the script I've done up to now.

app = Application('Keynote')
app.includeStandardAdditions = true


doc = app.Document({
    documentTheme: app.themes['White']
});
app.documents.push(doc)

// Create and append a new "Title & Bullets" slide.
slide = app.Slide({
    baseSlide: doc.masterSlides['Title & Bullets']
});

doc.slides.push(slide);

slide.defaultTitleItem().objectText="Hello"

slide.defaultBodyItem().objectText="Test1\ntest2"

doc.slides.push(slide);

slide.images.push(app.Image({file: Path("~/a.jpg")}))

The script above creates the presentation correctly and adds the text as it should, but it fails to add the image.

Any help would be appreciated.

Thanks in advance.

Regards, Pedro

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