0
votes
    tell application "Keynote"
        repeat
            delay 2 -- seconds.  This script does not need to run faster
            set the_time to current date
            set the_time to time string of (current date) -- get now()
            set the_time to every word of the_time -- slice
            set the_time to item 1 of the_time & ":" & item 2 of the_time -- extract fields
            set body of the first slide to the_time as string
        end repeat
    end tell
end tell

I would like to show the current time on slide 1 (in this case) in Keynote. I figured out that it should work with applescript as this future ist not supported in Keynote.

"Applescript says that „Keynote“ sends an error: body of slide 1 can not be converted in type specifier. So there's a problem with "set body of the first slide to the_time as string", but I don't see which.

1

1 Answers

0
votes
  • Application Keynote has documents
  • A document has slides
  • A slide has text items
  • A text item has an object text

Try

repeat
    delay 2 -- seconds.  This script does not need to run faster
    set the_time to text 1 thru -4 of time string of (current date)
    tell application "Keynote"
        set object text of text item 1 of first slide of document 1 to the_time
    end tell
end tell