I need my Mac to say the number of the current slide when presenting. I've written the below script, but it's not working as expected.
on slideNumber()
tell application "Keynote"
return the slide number of the current slide of the front document
end tell
end slideNumber
repeat
say slideNumber()
delay 1
end repeat
When I run this is will correctly say the current slide number in Keynote, however if I go to Keynote and change slides, or start presenting the slides, the Applescript doesn't update the slide number. If I go back to the Applescript window it immediately starts saying the correct slide number.
I've also tried this using:
on idle
say slideNumber()
return 1
end idle
and exporting as a stay-open application, but the same problem occurs.
Is it not possible to have the Applescript application return the correct slide number without the application/script being in the foreground? I'm using Keynote 6.2 if that's relevant.