Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

303
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!