0
    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

我想在 Keynote 的幻灯片 1(在这种情况下)上显示当前时间。我发现它应该与 applescript 一起使用,因为 Keynote 不支持这个未来。

“Applescript 说 „Keynote“ 发送错误:幻灯片 1 的正文无法在类型说明符中转换。所以“ set body of the first slide to the_time as string”有问题,但我看不出是哪个。

4

1 回答 1

0
  • 申请Keynotedocuments
  • 一个documentslides
  • 一个slidetext items
  • Atext item有一个object text

尝试

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
于 2016-03-29T12:55:42.540 回答