Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

304
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda